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
NKotak_Leecare
Helper III
Helper III

Date Slicer with customised Time Periods

Hello community,

 

I am looking for ways to create a date slicer which allows me to choose from WTD, MTD, QTD, YTD, WeekType, Financial Year, Financial Quarter. I have created those time periods in Date table however, I am not finding ways to add it to the Slicer. I tried creating a new DAX Table for selection but there are relationship/modelling issues with it. I have attached the photographs of Sample Data Pbix file - as i am unable to upload file. It is masked however, there is no option in the post to upload it. I am not sure how I can share the file.

 

Any suggestion or tricks will be much appreciated. Thank you for your help and support in advance!Batch Table.pngDate Table.pngRelationship.pngTimePeriod Table issue.png

 

Cheers,

Nidhi 

 

 

2 REPLIES 2
visheshjain
Solution Supplier
Solution Supplier

Hi @NKotak_Leecare ,

 

You can share the file via Google Drive or OneDrive link.

 

Please look into Calculation groups that should solve your problem.

 

Alternatively, you can just create a table from the 'Enter Data' on the report page and enter values QTD, MTD and YTD etc.

Then you can define a measure using the SWITCH() TRUE() and SELECTEDVALUE() functions, defining it like:

SWITCH(
           TRUE(),
          SELECTEDVALUE('Time Period Selection'[Column Name]) = "QTD", [QTD Measure],

          SELECTEDVALUE('Time Period Selection'[Column Name]) = "MTD", [MTD Measure],
          [YTD Measure]
)

 

This way you can put the slicer on your report and have it working without making any relationships.

 

I hope I have understood your problem correctly, and that the solution works for you.

If it does then please Kudo the post and mark is as the solution so that others can reach the solution faster.
If not then please provide more information.

 

Thank you,

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



amitchandak
Super User
Super User

@NKotak_Leecare , Check my video and the solution, that might help

https://community.powerbi.com/t5/Desktop/Required-custom-date-Slicer-Last-7-days-last-15-days-last-3...

 

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

 

 

calculation group can also help

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

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.