Forum Discussion
Happy_yeoh
2 years agoFrequent Visitor
Top n filter based on latest date
Dear All, I can show the top 5 products based on the revenue of the latest date over the last few weeks in Matrix (Power BI). Unfortunately, it cannot display in the line Chart. Please advise how ...
amitchandak
Super User
2 years agoHappy_yeoh , Try 2 measures like
Latest Revenue =
VAR LatestDate = maxx(allselecetd(Calendar_Date) , Calendar_Date[Date])
RETURN
CALCULATE(
SUM(Revenue[Revenue EUR]),
filter(Calendar_Date, Calendar_Date[Date]= LatestDate
))
Top 5 Revenue on Latest Date =
calculate([Latest Revenue]
KEEPFILTERS( TOPN( 5, ALLselected(Revenue[Product]),[Latest Revenue],DESC
)))
Happy_yeoh
2 years agoFrequent Visitor
I followed the DAX provided by you, but the outcome is not what I want. I want to show all dates instead of the latest date in the chart.