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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Last X days in a Matrix using a slicer Date

Good morning everyone.

I have a report with a Slicer Date and a Matrix, in the Matrix I´m using the Date field like a column and one metric in the values:

ruz_lee_0-1599808013385.png

I would like to see in the matrix the last 5 days using like max date the slicer date, for example, if in the last day in the slicer is 10/09/2020, the matrix should show the days from 06/09/2020 to 10/09/2020. I could do easly using a filter Top N in the matrix, but I can´t do it because in the matrix Im using another TOP N filter and in PowerBI isn´t possible to use more than one TOP N filter in one object, this my TOP N filter that Im using now:

ruz_lee_1-1599808294299.png

 

Could you help me? Thanks a lot

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

Hi @Anonymous 

You create a measure for  "Count of Total inc" as below with a condition to show last five days 

Measure = 

IF( 
    MAX('DATE'[Date]) > CALCULATE( MAX('DATE'[Date]), ALLSELECTED('DATE'[Date])) - 5, 
    Count(Table[Total Inc])
)
    

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

Hi @Anonymous 

You create a measure for  "Count of Total inc" as below with a condition to show last five days 

Measure = 

IF( 
    MAX('DATE'[Date]) > CALCULATE( MAX('DATE'[Date]), ALLSELECTED('DATE'[Date])) - 5, 
    Count(Table[Total Inc])
)
    

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Using your metric I get the result that I hope, thanks!

amitchandak
Super User
Super User

@Anonymous , the best way is relative date slicer.  If that can work.

 

Another way is suggested in this video if this can help

https://www.youtube.com/watch?v=duMSovyosXE

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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