Forum Discussion
Help with Top10 and Others visualization please.
- Anonymous1 year ago
Hi mjmm ,
Here I update the code for calculated column and measure based on your sample.
Project Label_Column = VAR _SUMMARIZE = SUMMARIZE ( ALLSELECTED ( 'ExampleDataFile' ), 'ExampleDataFile'[ProjectNr], "% of Total Planning Costs 2024 _ PR", DIVIDE ( CALCULATE ( SUM ( 'ExampleDataFile'[Costs] ), 'ExampleDataFile'[Status] = "Planning", 'ExampleDataFile'[Year] IN { 2024 } ), CALCULATE ( SUM ( 'ExampleDataFile'[Costs] ), FILTER ( ALL ( 'ExampleDataFile' ), 'ExampleDataFile'[Status] = "Planning" && 'ExampleDataFile'[Year] IN { 2024 } ) ) ) ) VAR _ADDRANK = ADDCOLUMNS ( _SUMMARIZE, "Rank", RANKX ( _SUMMARIZE, [% of Total Planning Costs 2024 _ PR],, DESC ) ) VAR _ADDLabel = ADDCOLUMNS ( _ADDRANK, "Project Label", IF ( [Rank] > 10, "Others", FORMAT([ProjectNr],"") ) ) VAR _CURRENTNAME = 'ExampleDataFile'[ProjectNr] RETURN MAXX(FILTER(_ADDLabel,[ProjectNr] = _CURRENTNAME),[Project Label])Measure = VAR _SUMMARIZE = SUMMARIZE ( 'ExampleDataFile' , 'ExampleDataFile'[Project Label_Column], "% of Total Planning Costs 2024 _ PR", SUMX(VALUES(ExampleDataFile[Project Label_Column]),DIVIDE ( CALCULATE ( SUM ( 'ExampleDataFile'[Costs] ), 'ExampleDataFile'[Status] = "Planning", 'ExampleDataFile'[Year] IN { 2024 } ), CALCULATE ( SUM ( 'ExampleDataFile'[Costs] ), FILTER ( ALL ( 'ExampleDataFile' ), 'ExampleDataFile'[Status] = "Planning" && 'ExampleDataFile'[Year] IN { 2024 } ) ) ) )) RETURN SUMX(_SUMMARIZE,[% of Total Planning Costs 2024 _ PR])Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi mjmm
This is not the exact solution but with some modification, it might work for you: https://youtu.be/qXLlqikGbRA?si=pLrj8QAEOp-FVDan
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: www.youtube.com/@Howtosolveprobem
Regards
Dear qqqqqwwwweeerrr,
I tried using (re-writing) this option and unfortunately I can't get this to work either. All of the sources of help have tested so far keep delivering nothing or just parts that work. I haven't been able to create what is required yet unfortunately.
Thanks for the link to the video though, I saved it anyway for potential future use.
Much appreciated.
Mark