Forum Discussion
alearner
Helper I
2 years agoMeasure as a Slicer for a Line Chart
Hello. First of all a thanks to all who are helping me out with the queries that I have in DAX and as such help me train on DAX, Looking for a solution for a readblocker that I am in. I have...
lbendlin
Super User
2 years agoI have created a calculated table which has the value of the slicer.
You cannot create a calculated column or calculated table from a measure. (Well, you can, but it makes no sense).
It needs to be the other way round - your measure needs to sense the selected value of a table (your year buckets) and then the measure needs to ba applied as a filter to the line chart.
alearner
Helper I
2 years agoI was finally able to achieve what I wanted using the below Measure for 1, 3 and 5 years. Now my chard dynamically changes the x axis as I select 1, 3 and 5 years.
Selected KPI FOR Landing Page NAV =
var maxdt1= CALCULATE(MAX(ALL_NAV[navDate]), all(ALL_NAV)) - 365
var maxdt3= CALCULATE(MAX(ALL_NAV[navDate]), all(ALL_NAV)) - 1095
var maxdt5= CALCULATE(MAX(ALL_NAV[navDate]), all(ALL_NAV)) - 1825
return SWITCH('Summary Page SLICER'[Slicer Selected],
1, CALCULATE(sum(ALL_NAV[navValue]), ALL_NAV[navDate] >= maxdt1),
3, CALCULATE(sum(ALL_NAV[navValue]), ALL_NAV[navDate] >= maxdt3),
5, CALCULATE(sum(ALL_NAV[navValue]), ALL_NAV[navDate] >= maxdt5),
sum(ALL_NAV[navValue]))