Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
Requirement: Two donut charts – One to show top city and second chart to show top second city.
When user select “India” from Country filter, First donut should show department of Coimbatore, since the count of Coimbatore is highest. Second chart must show department of Chennai.
We have tried with Top N filters, It doesn’t have an option to choose second top.
Any leads would be appreciated.
Thanks in Advance.
Solved! Go to Solution.
HI @Anonymous,
You can consider using measure formula to check the top n category and use it on visual level filter to filter the second one.
Measure =
VAR summary =
SUMMARIZE (
ALLSELECTED ( table ),
[Country],
[City],
"Count", COUNT ( table[Department] )
)
VAR _top =
MAXX ( summary, [Count] )
VAR _second =
MAXX ( FILTER ( summary, [Count] < _top ), [Count] )
VAR _city =
MAXX ( FILTER ( summary, [Count] = _second ), [City] )
RETURN
IF ( SELECTEDVALUE ( table[City] ) = _city, "Y", "N" )
Regards,
Xiaoxin Sheng
HI @Anonymous,
You can consider using measure formula to check the top n category and use it on visual level filter to filter the second one.
Measure =
VAR summary =
SUMMARIZE (
ALLSELECTED ( table ),
[Country],
[City],
"Count", COUNT ( table[Department] )
)
VAR _top =
MAXX ( summary, [Count] )
VAR _second =
MAXX ( FILTER ( summary, [Count] < _top ), [Count] )
VAR _city =
MAXX ( FILTER ( summary, [Count] = _second ), [City] )
RETURN
IF ( SELECTEDVALUE ( table[City] ) = _city, "Y", "N" )
Regards,
Xiaoxin Sheng
@Anonymous , Rank should help you.
Refer if this blog can help - One visual have only top1 another have only 2nd topper
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
@Anonymous ,
I think you need something like this.
Create a table TOPN with value 1 to 10 to use as filter.
Rank the Column
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 43 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |