Forum Discussion
Slicer to Update on Two Table using M Query
- 4 years ago
The M queries are not affected by user interactions (although they can be parameterized...).
I'd recommend appending these tables, defining a parameter table for the months to use in a slicer, and a measure that switches from returning actual to forecast based on the month selected by the slicer. E.g.
SwitchMeasure = VAR SelectedMonth = SELECTEDVALUE ( param[Month] ) RETURN CALCULATE ( [measure1], Table1[Actual/Forcast] = "ACT", Table1[Month] < SelectedMonth ) + CALCULATE ( [measure1], Table1[Actual/Forcast] = "FC", Table1[Month] >= SelectedMonth )where [measure1] is whatever metric you're interested in computing like SUM ( Table1[Sales] ) or whatever.
The M queries are not affected by user interactions (although they can be parameterized...).
I'd recommend appending these tables, defining a parameter table for the months to use in a slicer, and a measure that switches from returning actual to forecast based on the month selected by the slicer. E.g.
SwitchMeasure =
VAR SelectedMonth = SELECTEDVALUE ( param[Month] )
RETURN
CALCULATE (
[measure1],
Table1[Actual/Forcast] = "ACT",
Table1[Month] < SelectedMonth
)
+ CALCULATE (
[measure1],
Table1[Actual/Forcast] = "FC",
Table1[Month] >= SelectedMonth
)
where [measure1] is whatever metric you're interested in computing like SUM ( Table1[Sales] ) or whatever.