Forum Discussion
jimbob2285
1 year agoAdvocate IV
Measure filter not working
Hi I need some help, please... I've created the following measure filter, which allows the user to select a month and filter a table to show only the months from the beginning of the year up ...
- Anonymous1 year ago
Hi jimbob2285
Please try this:
Here I create 3 measures:
Selected Month - Month = VAR _Slicer = SELECTEDVALUE ( 'Calendar'[Date] ) RETURN CALCULATE ( SUM ( Ledger[Revenue] ), FILTER ( ALLSELECTED ( Ledger ), YEAR ( 'Ledger'[Date] ) = YEAR ( _Slicer ) && MONTH ( 'Ledger'[Date] ) = MONTH ( _Slicer ) ) )Selected Month - Cumulative = VAR _Slicer = SELECTEDVALUE ( 'Calendar'[Date] ) RETURN CALCULATE ( SUM ( Ledger[Revenue] ), FILTER ( ALLSELECTED ( Ledger ), YEAR ( 'Ledger'[Date] ) = YEAR ( _Slicer ) && 'Ledger'[Date] <= _Slicer ) )Previous Month - Cumulative = VAR _Slicer = SELECTEDVALUE ( 'Calendar'[Date] ) RETURN CALCULATE ( SUM ( Ledger[Revenue] ), FILTER ( ALLSELECTED ( Ledger ), YEAR ( 'Ledger'[Date] ) = YEAR ( _Slicer ) && 'Ledger'[Date] < _Slicer ) )Then add the 3 measures in the three cards, the result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
1 year agoNot applicable
Hi jimbob2285
Please try this:
Here I create 3 measures:
Selected Month - Month =
VAR _Slicer =
SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
CALCULATE (
SUM ( Ledger[Revenue] ),
FILTER (
ALLSELECTED ( Ledger ),
YEAR ( 'Ledger'[Date] ) = YEAR ( _Slicer )
&& MONTH ( 'Ledger'[Date] ) = MONTH ( _Slicer )
)
)
Selected Month - Cumulative =
VAR _Slicer =
SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
CALCULATE (
SUM ( Ledger[Revenue] ),
FILTER (
ALLSELECTED ( Ledger ),
YEAR ( 'Ledger'[Date] ) = YEAR ( _Slicer )
&& 'Ledger'[Date] <= _Slicer
)
)Previous Month - Cumulative =
VAR _Slicer =
SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
CALCULATE (
SUM ( Ledger[Revenue] ),
FILTER (
ALLSELECTED ( Ledger ),
YEAR ( 'Ledger'[Date] ) = YEAR ( _Slicer )
&& 'Ledger'[Date] < _Slicer
)
)
Then add the 3 measures in the three cards, the result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.