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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
thhmez7
Helper III
Helper III

DAX - Show latest two column value by Date

Hello,

I'd like to create a measure, that show the latest two attributes of the column Type by Date.

So in this example for Brand A, the measure should only show Type = "Red" on April and May. For Brand B it should show Blue in April and Red in May. The attributes can be concatenated or displayed in each row. 

thhmez7_0-1655801130755.png

Thank you for your help.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@thhmez7 , if you do not want that based on slicer value, You can use column rank and use that as filter

 

rank = rankx(filter(Table, [Brand] = earlier([Brand]) ) , [Date],,desc,dense)

 

filter for <= 2 in a measure of visual level filter

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@thhmez7 , if you do not want that based on slicer value, You can use column rank and use that as filter

 

rank = rankx(filter(Table, [Brand] = earlier([Brand]) ) , [Date],,desc,dense)

 

filter for <= 2 in a measure of visual level filter

Thank you.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.