Hi All,
I have the filtres Year/Month and date, and I have a lot of KPIS and I want to display them by default at J-1 once the user open the report or to be more specifique once no filtre is selected, in my model I have a fact table linked to a dim date.
any DAX formula to sugest please🏆?
I tried this example to show the number of Acqusition
yes/NO Slicer Selection = Var Select_Slicer = MAX('Dim DATE'[Date])-1
Return
IF(NOT(ISFILTERED('Dim DATE'[Date])),CALCULATE([All Acquisition],FILTER('Dim DATE','Dim DATE'[Date]= Select_Slicer)),[All Acquisition])
but it didn't work
Solved! Go to Solution.
Hi @IBKA ,
As far as I know, if you want to use ISFILTERED() function to check whether your slicer is selected in your code, the table with the column in that slicer should be unrelated to your data table. So please inactive or remove the relationship between your DimDate table and Data table.
Then update [All Acquisition] with some filter from DimDate table.
yes/NO Slicer Selection =
VAR Select_Range =
VALUES ( 'Dim DATE'[Date] )
VAR Select_Slicer =
MAX ( 'Dim DATE'[Date] ) - 1
VAR True_Result =
CALCULATE (
[All Acquisition],
FILTER ( 'Fact Table', 'Fact Table'[Date] IN Select_Range )
)
VAR False_Result =
CALCULATE (
[All Acquisition],
FILTER ( 'Fact Table', 'Fact Table'[Date] = Select_Slicer )
)
RETURN
IF ( ISFILTERED ( 'Dim DATE'[Date] ), True_Result, False_Result )
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @IBKA ,
As far as I know, if you want to use ISFILTERED() function to check whether your slicer is selected in your code, the table with the column in that slicer should be unrelated to your data table. So please inactive or remove the relationship between your DimDate table and Data table.
Then update [All Acquisition] with some filter from DimDate table.
yes/NO Slicer Selection =
VAR Select_Range =
VALUES ( 'Dim DATE'[Date] )
VAR Select_Slicer =
MAX ( 'Dim DATE'[Date] ) - 1
VAR True_Result =
CALCULATE (
[All Acquisition],
FILTER ( 'Fact Table', 'Fact Table'[Date] IN Select_Range )
)
VAR False_Result =
CALCULATE (
[All Acquisition],
FILTER ( 'Fact Table', 'Fact Table'[Date] = Select_Slicer )
)
RETURN
IF ( ISFILTERED ( 'Dim DATE'[Date] ), True_Result, False_Result )
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
211 | |
76 | |
70 | |
69 | |
53 |
User | Count |
---|---|
194 | |
96 | |
80 | |
75 | |
67 |