Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I've got this as incoming data...
I'm sending the data to a Sankey chart, where the "weight" is the DISTINCTCOUNT of customerkeys. I want to be able to offer the user a Top N chiclet slicer to keep the chart readable. To that end, I created a computed measure [dRanker], that will RANKX the number of customers over my [source] values...
The problem is that the Sankey chart needs both a [source] and a [dest] to make it useful. When I add a visual filter on the Sankey to only show where dRanker is <= 2, I get 9 different [source] values, not just the 2 highest ranked...
When I add [dest] to my data table, I can see that many more [source]s are getting RANKed as <= 2...
I'm guessing that's why I'm getting so many results in the Sankey as well, so... How do I tell RANKX() that I want it to rank over the DISTINCTCOUNT of CustomerKeys for BOTH [source] and [dest]? I feel like the tSQL RANK() function allows this, but I can't seem to find similar overload functionality for RANKX() in DAX.
Another approach that would be just as good... How could I get the Sankey chart to only show [source] values that appear in the original table above where the [source] ranking is correct?
Here's the dRanker DAX...
dRanker = RANKX(ALLSELECTED(FW17[source]), [CustCount])
... and the [CustCount] calculated measure...
CustCount = DISTINCTCOUNT(FW17[customerkey])
Am I thinking about this wrong? What's wrong with my brain. It's usually pretty good.
Hi @gjohnson900
First you need to detemine how to calcuate the DISTINCTCOUNT of customerkeys, in your previous step, you just add the column [customerkeys] to the table and select "count(distinct)", right? in this way, the result will change with the columns you add to the table.
Thus your [Rank] column also become different.
So first please let me know how you would like the DISTINCTCOUNT of customerkeys.
Best regards
maggie
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |