Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Need to show top 5 services in table visual.
Service Name | Count | Total Count |
Apple | 43 | 346 |
Samsumg | 67 | 346 |
mi | 80 | 346 |
oppo | 84 | 346 |
72 | 346 |
Measure written we not able to do sum the count of all Services,
Solved! Go to Solution.
Hi,
Thanks for this approach,but we need to do this in existing table considering relationship.If i create table function then only few slicer interacting and not all.
Hi @raj777karthik ,
If you don't want to create a new table, pleaser try following DAX to sort [Thread_] column:
Rank = RANKX('Stack Tags','Stack Tags'[Thread__],'Stack Tags'[Thread__],DESC)
Calculate the sum of the top 5:
Total count = CALCULATE(SUM('Stack Tags'[Thread__]),FILTER(ALL('Stack Tags'),'Stack Tags'[Rank]<=5))
Add the [Rank] column to Filters to filter out the top5:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
In this since my service oppo has 84 count the rank is taking all these for 1 and second service mi has 80 count ,rank is taken as 85 .And for third its taking as rank 165.
Hi @raj777karthik ,
Please try following DAX to create three measures:
Count = COUNT('Stack Tags'[Service])
Rank = RANKX(ALLSELECTED('Stack Tags'),[Count],,DESC,Dense)
Total count = CALCULATE([Count],FILTER(ALL('Stack Tags'),'Stack Tags'[Rank]<=5))
You will get result you want:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
In Rank measure,im getting values 1 and 2.
Same as you have mentioned.Created measure for this.
Rank = RANKX(ALLSELECTED('Stack Tags'),[Count],,DESC,Dense)
Hi @raj777karthik ,
OK, I know the reason of the problem.
Please try following DAX:
Rank = IF(HASONEVALUE('Stack Tags'[Service]),
RANKX(ALL('Stack Tags'[Service]),[Count],,DESC,Dense)
)
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Thanks Rank is working fine as expected,but the total count measure is returning all the values.
Hi @raj777karthik ,
Can you tell me how the [Count] measure did you write?
It's better to share with me a screenshot of the original data (hide sensitive information).
Best regards
Yadong Fang
Measure written:
Total count = CALCULATE([Count],FILTER(ALL('Stack Tags'),'Stack Tags'[Rank]<=5))
Thanks Yadong.Its working fine.
Hi @raj777karthik ,
This is my test table:
Please try following DAX to create a new table:
New Table = TOPN(5,SUMMARIZE('Stack Tags','Stack Tags'[Service],'Stack Tags'[Thread__]),'Stack Tags'[Thread__],DESC)
Then create a measure to calculate total count:
Total count = CALCULATE(SUMX('New Table',CALCULATE(SUM('New Table'[Thread__]))),ALL('New Table'))
You will get result you want:
If I misunderstand your demands, please feel free to contact us in time.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
45 | |
25 | |
19 | |
16 | |
8 |
User | Count |
---|---|
70 | |
48 | |
45 | |
19 | |
16 |