Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
It seems fairly simple in theory but I can't figure out a way to get this to work.
I have one date slicer (Year) and another one (Date).
The two slicers are derived from two different calendar tables.
If I selected 2019 in the Year slicer, I would like the Date slicer to only show dates in 2019 and after.
I'm not sure if this would be possible.
Any input would be greatly appreciated!
Thanks!
Solved! Go to Solution.
Hi @jayt93 ,
unfortunately, this won't work as you expect.
I created a measure like this:
showDate =
var SelectedYearCheck = YEAR(CALCULATE(MIN('Date Invoice'[Date])))
var currentyear = YEAR(CALCULATE(MAX('Date Delivery'[Date])))
return
IF(currentyear >= SelectedYearCheck , 1 , 0)
I use this measure to control the items that are displayed in the segmentation of the 2a date like this:
The measure will be honored if the list option is used for the 2a date slicer.
The measure will not be respected by the visualizations between, before or after.
You can create an idea in ideas.powerbi.com or mark this behavior as a problem.
Best regards
Tom
Hi, @jayt93
As is suggested by @TomMartens , you may manage to do it with visual level filter. You need to use 'list' or 'drop down' slicer type. I created data to reproduce your scenario.
Date Table:
Date Table = CALENDAR(DATE(2017,1,1),DATE(2020,12,31))
Year Table:
Year Table = CALENDAR(DATE(2018,1,1),DATE(2019,12,31))
Then you may create a measure as follows.
IsDisplay =
var _yeardate = SELECTEDVALUE('Year Table'[Year].[Year])
return
IF(
YEAR(SELECTEDVALUE('Date Table'[Date]))>=_yeardate,
1,0
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jayt93 ,
unfortunately, this won't work as you expect.
I created a measure like this:
showDate =
var SelectedYearCheck = YEAR(CALCULATE(MIN('Date Invoice'[Date])))
var currentyear = YEAR(CALCULATE(MAX('Date Delivery'[Date])))
return
IF(currentyear >= SelectedYearCheck , 1 , 0)
I use this measure to control the items that are displayed in the segmentation of the 2a date like this:
The measure will be honored if the list option is used for the 2a date slicer.
The measure will not be respected by the visualizations between, before or after.
You can create an idea in ideas.powerbi.com or mark this behavior as a problem.
Best regards
Tom
Ah that's unfortunate!
Definitely hope that they would implement that in the future.
I appreciate the alternative solution though!
If you want to control one from another then take the year from the same table from where you are taking a date. What is the advantage of two tables?
User | Count |
---|---|
102 | |
90 | |
80 | |
71 | |
70 |
User | Count |
---|---|
114 | |
100 | |
97 | |
72 | |
68 |