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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Nissa23
Helper I
Helper I

Top N by row (dates) from multiples columns

Hi,

 

I'd like to do a visual showing only Top (N) using multiples columns.

 

datesCol1col2col3col4 Wanted Result in visual
2023-04-2025201545 col1 :25; col4: 45
2023-04-2112351034 col4: 34; col2: 35
2023-04-2245223648 45;48
2023-04-2312473114 47;31
2023-04-2456203312 56;33

 

I'm using the filter but I can just choose one column not all others :

Nissa23_0-1683819719460.png

Do you have idea how to do it ?

 

Thanks

Nissa

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @Nissa23 ,

 

Please try:

First Unpivot your data:

vjianbolimsft_0-1684140098546.png

Output:

vjianbolimsft_1-1684140113090.png

Then apply the measure:

TOPN_Value = 
var _a = TOPN(2,FILTER(ALL('Table'),'Table'[dates]=SELECTEDVALUE('Table'[dates])),[Value],DESC)
return IF(SELECTEDVALUE('Table'[Attribute]) in SELECTCOLUMNS(_a,"Attribute",[Attribute]),SUM('Table'[Value]))

Final output:

vjianbolimsft_2-1684140528252.png

Best Regards,

Jianbo Li

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

View solution in original post

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @Nissa23 ,

 

Please try:

First Unpivot your data:

vjianbolimsft_0-1684140098546.png

Output:

vjianbolimsft_1-1684140113090.png

Then apply the measure:

TOPN_Value = 
var _a = TOPN(2,FILTER(ALL('Table'),'Table'[dates]=SELECTEDVALUE('Table'[dates])),[Value],DESC)
return IF(SELECTEDVALUE('Table'[Attribute]) in SELECTCOLUMNS(_a,"Attribute",[Attribute]),SUM('Table'[Value]))

Final output:

vjianbolimsft_2-1684140528252.png

Best Regards,

Jianbo Li

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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