Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

TopN + Others - getting required output but table visual total is Wrong

Dear ,

Created measure for TopN + Others with help of community post thred , but I'm facing the issue with Total.

Here is the steps

1) Created a table :

Segment Table =
UNION (DISTINCT(
    ALLNOBLANKROW ( Product_Master[Seg] )),
    { "OTHERS" }
)

2) Created Rank Measure :
Seg_Rank =
RANKX(ALLSELECTED('Segment Table'[Seg]),[Value])

3) Created Topn+ Others measure

TopN+Others =
VAR __TopN =
TOPN ( [TopN Value], ALL ('Segment Table'), [Value], DESC )
RETURN
IF ( [Seg_Rank] <= [TopN Value],[Value],
IF ( SELECTEDVALUE ( 'Segment Table'[Seg] ) = "OTHERS",
CALCULATE ([Value], ALL ( 'Segment Table'[Seg] ) )- SUMX ( __TopN, [Value] ),
BLANK ()
)
)
 

 

From these getting expected result for Top N and Others but the total is the sum of TopN values not included "Others" so I created one more measure (found some soln in Community)

Topn + Other = SUMX(SUMMARIZE('Segment Table','Segment Table'[Seg]),[TopN+Others])

But now the total is correct but value for "Others" is blank 

irshun03_3-1706094497041.png

 


Can any one suggest any solution for this?

Thanks in advance.

 
 
3 REPLIES 3
Anonymous
Not applicable

Understood , this because of filter applied in the table visual as I need to sort the visual by "Segment Rank" which should not shown in the table. so created filter TopN_Filt and applied .

irshun03_0-1706101444563.png

Any solution to fix this or how to sort a table (in chart we can add any sort column  to Tooltip) with another measure?
 

Anonymous
Not applicable

Hi, @Anonymous

Based on the data provided in your table, I gave a simple example to illustrate my understanding.I created a simple table with Culumn2 is sorting broken up.

vyilongmsft_0-1706173461308.png

If you need to sort it, you can New Column in Power Query and then sort the New Column.

vyilongmsft_1-1706173461311.png

vyilongmsft_2-1706173489973.png

So you can sort the data in the table. This is only my partial answer to your question, if it doesn't solve your doubts, provide me with more data or more details.

 

 

 

How to Get Your Question Answered Quickly 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you dear @Anonymous for your reply
My requirement is to sort the table visual by a measure "Seg_Rank" (which Dynamically change based on the slicer selection) and no need to show the "Seg_Rank" in Table visual.
Will add link for sample file


Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.