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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors