Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
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 all,
I need to show the top five and the balance group to others in my report. I have used the following measure:
It worked perfectly fine until I filtered it by month. When I filtered it by month, the row for "others" disappeared, and the grand total for the month was also incorrect. Can anyone help?
Thanks!
Solved! Go to Solution.
Hi @joeywong ,
According to your description, here are my steps you can follow as a solution.
(1) We can create measures.
Measure =
var _top5 = TOPN(5,VALUES('Table'[Customer No]), CALCULATE(SUM('Table'[Amount])))
var _t2 = SELECTCOLUMNS(_top5,"No" , [Customer No])
var _cur_no= MAX('Unrelated ID'[Customer No])
var _others = EXCEPT(VALUES('Table'[Customer No]),_t2)
return
IF(_cur_no="other",CALCULATE(SUM('Table'[Amount]),FILTER('Table','Table'[Customer No] in _others)),IF(MAX('Unrelated ID'[Customer No]) in _t2 , CALCULATE(SUM('Table'[Amount]), FILTER('Table','Table'[Customer No]=_cur_no)) ,BLANK()))Measure 2 =
var _total=
SUMX( CROSSJOIN(VALUES('Table'[MM YY]),VALUES('Unrelated ID'[Customer No])),[Measure])
return
_total
(2) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @joeywong ,
According to your description, here are my steps you can follow as a solution.
(1) We can create measures.
Measure =
var _top5 = TOPN(5,VALUES('Table'[Customer No]), CALCULATE(SUM('Table'[Amount])))
var _t2 = SELECTCOLUMNS(_top5,"No" , [Customer No])
var _cur_no= MAX('Unrelated ID'[Customer No])
var _others = EXCEPT(VALUES('Table'[Customer No]),_t2)
return
IF(_cur_no="other",CALCULATE(SUM('Table'[Amount]),FILTER('Table','Table'[Customer No] in _others)),IF(MAX('Unrelated ID'[Customer No]) in _t2 , CALCULATE(SUM('Table'[Amount]), FILTER('Table','Table'[Customer No]=_cur_no)) ,BLANK()))Measure 2 =
var _total=
SUMX( CROSSJOIN(VALUES('Table'[MM YY]),VALUES('Unrelated ID'[Customer No])),[Measure])
return
_total
(2) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
FYI on another approach to get TopN/Others functionality with the Deneb visual.
TopN and Others with Deneb in Power BI - YouTube
Pat
Hi AIB,
Thank you for your help in advance.
I am quite new to power bi. I am not quite sure this is the correct way to share the PBIX file. If you can't open the file, please let me know.
I have tried writing these two measures (Top NR and Top NR2). Obviously, these two measures don't work.
Really appreciate your help. Thanks!
Joey
I do not see the measure working without the filters in the pbix you shared. Not sure I understand what you need. Can you show an example with the result based on sample data?
|
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
Hi @johnt75
Can you share a pbix?
|
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 33 | |
| 32 | |
| 32 |