Forum Discussion
Setting a default value in a slicer
- 4 years ago
Hi Syndicate_Admin ,
Maybe you can try the function ISFILTERED().
IF no selection, then get MONTH of TODAY() and use CALCULATE() to sum the value of this month.
You can refer the following expression:
Total = VAR _today = TODAY() VAR _Defult = CALCULATE( SUM( 'DATE'[Value] ), FILTER( ALL( 'DATE' ), MONTH( [DATE] ) = MONTH( TODAY() ) ) ) RETURN IF( ISFILTERED( 'DATE'[Month] ), SUM( 'DATE'[Value] ), _Defult )The result:
I put the pbix file in the end you can refer.
Best RegardsCommunity Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Syndicate_Admin ,
Maybe you can try the function ISFILTERED().
IF no selection, then get MONTH of TODAY() and use CALCULATE() to sum the value of this month.
You can refer the following expression:
Total =
VAR _today =
TODAY()
VAR _Defult =
CALCULATE(
SUM( 'DATE'[Value] ),
FILTER( ALL( 'DATE' ), MONTH( [DATE] ) = MONTH( TODAY() ) )
)
RETURN
IF( ISFILTERED( 'DATE'[Month] ), SUM( 'DATE'[Value] ), _Defult )
The result:
I put the pbix file in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.