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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

TOPN on rows

Hi friends,
Look in this table

IDValue1Value2Value3Reslut
1105115
220102040
330151747
440201860


I have tried to get the two highest values from Value1, Value2 and Value3 and Sum this in the Result for each row on that ID.
But i dont mangae to solve this.

Is there any out there who can help me.

1 ACCEPTED SOLUTION
amustafa
Solution Sage
Solution Sage

Hi @Anonymous 

 

You need to create a new colunm (not measure) in your table. See sample DAX. 

TopNSum =
VAR v1 = 'Table'[Value1]
VAR v2 = 'Table'[Value2]
VAR v3 = 'Table'[Value3]
VAR SortedValues =
    TOPN(2, {v1, v2, v3}, [Value])
RETURN
    SUMX(SortedValues, [Value])
 
If I answered your question, please mark this thread as accepted.
Follow me on LinkedIn:
https://www.linkedin.com/in/mustafa-ali-70133451/




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@amustafa 
Thanks alot!
You made my day a little bit better 🙂

amustafa
Solution Sage
Solution Sage

Hi @Anonymous 

 

You need to create a new colunm (not measure) in your table. See sample DAX. 

TopNSum =
VAR v1 = 'Table'[Value1]
VAR v2 = 'Table'[Value2]
VAR v3 = 'Table'[Value3]
VAR SortedValues =
    TOPN(2, {v1, v2, v3}, [Value])
RETURN
    SUMX(SortedValues, [Value])
 
If I answered your question, please mark this thread as accepted.
Follow me on LinkedIn:
https://www.linkedin.com/in/mustafa-ali-70133451/




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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