我正在尝试为来自SQL数据库的数据构建Power BI报告,我必须使用Drillthrough来显示详细信息页面。连接数据集的唯一可行方法是使用数据库行ID。
从用户的角度来看,行ID不会添加任何值,但会产生很多噪音。
有没有办法使用行ID进行钻取而不在可视化中显示它们?
答案 0 :(得分:0)
是的,这可以在当前版本的Power Bi Desktop中使用解决方案解决方案,该解决方案涉及在父(或摘要)页面中隐藏行ID列。
以下表为例:
ALBUM
+---------+------------------------+
| AlbumId | AlbumName |
+---------+------------------------+
| 1 | Hoist |
+---------+------------------------+
| 2 | The Story Of the Ghost |
+---------+------------------------+
TRACK
+---------+---------+--------------------------+
| TrackId | AlbumId | TrackName |
+---------+---------+--------------------------+
| 1 | 1 | Julius |
+---------+---------+--------------------------+
| 2 | 1 | Down With Disease |
+---------+---------+--------------------------+
| 3 | 1 | If I Could |
+---------+---------+--------------------------+
| 4 | 1 | Riker's Mailbox |
+---------+---------+--------------------------+
| 5 | 1 | Axilla, Part II |
+---------+---------+--------------------------+
| 6 | 1 | Lifeboy |
+---------+---------+--------------------------+
| 7 | 1 | Sample In a Jar |
+---------+---------+--------------------------+
| 8 | 1 | Wolfmans Brother |
+---------+---------+--------------------------+
| 9 | 1 | Scent of a Mule |
+---------+---------+--------------------------+
| 10 | 1 | Dog Faced Boy |
+---------+---------+--------------------------+
| 11 | 1 | Demand |
+---------+---------+--------------------------+
| 12 | 2 | Ghost |
+---------+---------+--------------------------+
| 13 | 2 | Birds of a Feather |
+---------+---------+--------------------------+
| 14 | 2 | Meat |
+---------+---------+--------------------------+
| 15 | 2 | Guyute |
+---------+---------+--------------------------+
| 16 | 2 | Fikus |
+---------+---------+--------------------------+
| 17 | 2 | Shafty |
+---------+---------+--------------------------+
| 18 | 2 | Limb by Limb |
+---------+---------+--------------------------+
| 19 | 2 | Frankie Says |
+---------+---------+--------------------------+
| 20 | 2 | Brian and Robert |
+---------+---------+--------------------------+
| 21 | 2 | Water in the Sky |
+---------+---------+--------------------------+
| 22 | 2 | Roggae |
+---------+---------+--------------------------+
| 23 | 2 | Wading in the Velvet Sea |
+---------+---------+--------------------------+
| 24 | 2 | The Moma Dance |
+---------+---------+--------------------------+
| 25 | 2 | End of Session |
+---------+---------+--------------------------+
将它们添加为数据源。应该创建AlbumId之间的1:多关系。使用包含AlbumId和AlbumName的表创建父页面。然后使用仅包含TrackName列的表创建详细信息页面。在详细信息页面的钻取过滤器字段中,拖动相册表 - > AlbumId到这个领域。
现在返回到父页面,注意当您右键单击相册时,您会获得详细信息页面的钻取菜单。这样可行,但现在您的父页面上有一个混乱的AlbumId列。
解决方法是在父报表上隐藏AlbumId。首先转到父报表和列标题中表格的格式(油漆滚筒)菜单 - >自动换行将其关闭。然后拖动表的列分隔符以隐藏AlbumId。请参阅下面的图像之前和之后。
隐藏之前
隐藏后
如果你想看到它的实际效果,我有powerbi文件posted here。