Forum Discussion

rajasekaro's avatar
rajasekaro
Helper III
6 months ago
Solved

Country based Calendar Silzer

Hi Team,

I have two filters: Country and Date.
When I select India, the date filter should automatically display the fiscal year range (01-04-2025 to 31-03-2026).
When I select USA, the date filter should display the standard calendar year (01-01-2026 to 31-12-2026)

Expected output

 

 

7 Replies

  • Create a small table that defines the valid ranges per country, then filter measures using that range. Relate: Country[Country] → CountryPeriod[Country] (1:*)

     

    CountryPeriod =
    DATATABLE(
        "Country", STRING,
        "Period",  STRING,
        "StartDate", DATE,
        "EndDate",   DATE,
        {
            {"India","FY 2025-26", DATE(2025,4,1),  DATE(2026,3,31)},
            {"USA",  "CY 2026",    DATE(2026,1,1),  DATE(2026,12,31)}
        }
    )

     

     

    Then Apply the range to your measures as:

     

    Sales =
    VAR s = MIN ( CountryPeriod[StartDate] )
    VAR e = MAX ( CountryPeriod[EndDate] )
    RETURN
    CALCULATE (
        [Sales],
        DATESBETWEEN ( 'Date'[Date], s, e )
    )
    
    

     

    If you don’t want to rewrite every measure: use a Calculation Group to wrap SELECTEDMEASURE() with the same DATESBETWEEN() logic, then set the calc item on the page filter.

    • rajasekaro's avatar
      rajasekaro
      Helper III

      I want to Control the date Slizer Based on Country selection.

  • You can also create 2 bookmarks, one with date slicer capturing the Fiscal Year for 'India' and the other with date slicer capturing Calendar Year for 'USA'. The bookmark button will replace your Country slicer. 

    When a bookmark is triggered, it restores the full page filter state, so any other visuals that depends on Country and Date will update consistently. 

     

     

     

  • rajasekaro I suggest trying to implement the new calendar feature:
    Power BI’s enhanced calendar features, notably the September 2025 preview of Calendar-based Time Intelligence, allow users to define custom, non-Gregorian, and retail-specific (4-4-5, 4-5-4) calendars directly in the semantic model. This enables complex time intelligence—like week-to-date (WTD) calculations—without complex DAX, offering flexibility for fiscal, ISO, or weekly reporting.


    please check this links:
    https://www.youtube.com/watch?v=ILZy6pFHY5s&t=5s
    https://towardsdatascience.com/use-cases-for-the-new-calendar-based-time-intelligence/#:~:text=The%20first%20prerequisite%20is%20to,data%20for%20each%20use%20case.


    I hope this helps, if so please mark it as a solution. kudos are welcome.

  • You can maintain two calendar tables and use field parameters and a slicer switch between the different date columns. 

    • v-priyankata's avatar
      v-priyankata
      Community Support

      Hi rajasekaro 

      Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.