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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.