Forum Discussion
Show variance based on filter selection
Anonymous ,
Modify the measure using dax below:
PREV. WK FCST =
CALCULATE (
[FCST],
FILTER ( ALLSELECTED ( Table ), DATEADD ( 'CALENDAR'[Date], -7, DAY ) )
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Hello v-yuta-msft
For some reason it doesn't work. I am not sure whether I am doing it properly or not but just to be sure, to which 'table' should I refer the ALLSELECTED function? I tried with my calendar table and didn't work.
Thanks in advance!
Regards,
- v-yuta-msft6 years ago
Community Support
Anonymous ,
This based on your slicer. If you build slicer based on date column in the fact table, then the expression should be ALLSELECTED(Fact_Table).
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
v-yuta-msft , unfortunately it's not working.
So, the measure is working but it's not doing what it's supposed to.Slicer is based on a column in my CALENDAR table which is, of course, connected to my fact table.
First 3 colums are my current measures, last one the one using your solution
PREV. WK FCST =CALCULATE ( [FCST], FILTER ( ALLSELECTED ( 'CALENDAR' ), DATEADD('CALENDAR'[Date], -7,DAY) ))SPI WEEK FCST PREV. WK FCST PREV. WK FCST V2 202003 1,868,586 1,861,980 5,628,067 201952 1,904,024 1,895,539 5,628,067 201949 1,855,457 1,836,393 5,628,067 So, I selected 3 different WKS as you can see in table above where the first 3 columns are my current measures and the last one the one you have proposed. What it's actually doing is a SUM of all the selected weeks FCST .
Instead, I would like it to show as follows:
SPI WEEK FCST PREV. WK FCST PREV. WK FCST V2 202003 1,868,586 1,861,980 1,904,024 201952 1,904,024 1,895,539 1,855,457 201949 1,855,457 1,836,393 BLANK Does it makes sense?
Thanks a lot for your time buddy.
Regards,