Forum Discussion
Anonymous
7 years agoNot applicable
Dynamic isfiltered dax expression
Hi Experts, I have a scenario as follows: If filter (slicer) does not have any selected value (Year/Month) then the table should show current months sales. when the Year/Month is filtered (s...
- 7 years ago
Hi Anonymous ,
To create a measure as below.
measure = VAR sum1 = SUM ( 'Table'[value] ) VAR sumcurrecnt = CALCULATE ( SUM ( 'Table'[value] ), FILTER ( 'Table', YEAR ( 'Table'[Date] ) = YEAR ( TODAY () ) && MONTH ( 'Table'[Date] ) = MONTH ( TODAY () ) ) ) RETURN IF ( ISFILTERED ( 'Table'[year month] ), sum1, sumcurrecnt )Pbix as attached.
v-frfei-msft
Community Support
7 years agoHi Anonymous ,
To create a measure as below.
measure =
VAR sum1 =
SUM ( 'Table'[value] )
VAR sumcurrecnt =
CALCULATE (
SUM ( 'Table'[value] ),
FILTER (
'Table',
YEAR ( 'Table'[Date] ) = YEAR ( TODAY () )
&& MONTH ( 'Table'[Date] ) = MONTH ( TODAY () )
)
)
RETURN
IF ( ISFILTERED ( 'Table'[year month] ), sum1, sumcurrecnt )
Pbix as attached.