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
derekmalag
New Member

Date slicer between Start_End and End_Date (Being End_Date dependant on a dropdown)

Hi, I'm trying to apply some filtering in a line chart visual 

I have 2 tables:

  1. Period - Includes start date, end date and a id for the period/month 
  2. Events - Includes EventID, Date and Period Identifier

Screenshot below of a sample data. Relationship is between 1:1 Period-PeriodId

derekmalag_0-1638975955098.png

 

Then I have the following visual

derekmalag_1-1638976137737.png

 

The line chart should be filtered using the "slicer between" the dates, and the "slicer between" should not have an end date greater than the end date of the Period dropdow. The target scenario is:

  • if I selected period 7 (July), y can modify my slicer between 01/01/2021 and 31/07/2021. 
  • If I select period 5 (May), I can modify my slicer only between 01/01/2021 and 31/05/2021

 

My approach so far is:

  1. create another table for 'DatesFilter' and a calculated column 'MyValuesColumn' based on the selected value of the dropdown, something like MyValuesColumn= IF('DatesFilter'[End_Date]<=SELECTEDVALUE('period'[End_Date]),1,0)
  2. Edit the interactions to make the line chart dependant on Slicer, and the slicer dependant on the dropdown
  3. Apply filter to the slicer when MyValuesColumn = 1

This is not working for me as I guess I can use SELECTEDVALUE to make updates to a calculated column. Also I'm not convinced this is the best approach so any idea wwould be really helpful.

 

Many thanks

 

1 REPLY 1
lbendlin
Super User
Super User

Familiarize yourself with the way "What if?" parameters work in Power BI.

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.