Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
IBKA
New Member

Default date J-1 once we open the report all the DAX measures should be filtred at J-1 by default

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 

 

IBKA_0-1674832129745.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.