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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
WBscooby
Helper III
Helper III

Matrix containing dates relative to slicer filter

Hi

 

I suspect what I am trying to achieve is quite easy but I have tried various ways with no luck!

 

My report is looking at weekly data. The data is calculated elsewhere and imported as a table.

 

The table has summary data for several dates but for the purpose of the report, only data that falls on a Friday (end of week) is required.

 

Based on the data selected in the slicer, I would like to dynamically display 3 weeks of data taking the slicer date as the latest date e.g. date selected = 29/10/21, the 3 weeks will be 15/10/21, 22/10/21, 29/10/21. If date selected is 22/10/21, the 3 weeks will be 08/10/21, 15/10/21 and 22/10/21

 

I have written a measure to try to identify the dates in the range but I can’t work out how to translate this into the columns!

 

Dates in period =

Var _MaxDate = MAX('Slicer Date'[Slicer Date])

vAR _MinDate = _MaxDate-14

Return

DATESBETWEEN('Date'[End Day of Week Friday],_MinDate,_MaxDate)

Any help would be appreciated - sample file attached.

 

Thank you

 

https://1drv.ms/u/s!Ap6q8W-mvm27g-c8oKb54c89mou7_A?e=GY7Kh5

1 ACCEPTED SOLUTION
hmahesh94
Helper I
Helper I

Hi @WBscooby ,

 

I believe you have a similar situation that is solved below:

Select last 6 months based on user single selection 

 

This is a great video and it is very clearly explained. Hope this helps

 

If you think my suggestion answered your question, please give it a like and Accept it as a solution.

 

Cheers!

View solution in original post

2 REPLIES 2
hmahesh94
Helper I
Helper I

Hi @WBscooby ,

 

I believe you have a similar situation that is solved below:

Select last 6 months based on user single selection 

 

This is a great video and it is very clearly explained. Hope this helps

 

If you think my suggestion answered your question, please give it a like and Accept it as a solution.

 

Cheers!

Awesome - thank you! This worked perfectly and the video was really clear so helped me understand what I was doing rather than just copying a bit of code!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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