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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
alianazambori
Frequent Visitor

Multiple Starting and ending Year deepening on the country

Hi

 

I have the following scenario 

alianazambori_0-1711622175920.png

I must display data for each country differently. 
If I select Fiscal Year it is the same for all countries, my x-axis starts in January
If I select Crop Year, depending on the country that is selected in Country slicer, I must have the x-axis starting with July, April or October (as my Crop years are (July-June), (April-March) or (Oct-Sept)

Also, I have a visual where I have cumulated sum, from the first day to the last day that the user selects in date slicer. Let's say from 20.07.2023 to 20.03.2024
In this case, if the Fiscal year is selected this data belongs to the corresponding year 2023, respectively 2024.
But if the user selects Crop year and the Country selected has the crop year July-June, this data must belong to Year 2024.

I don't know how to build the Date Calendar table to support all these scenarios.
Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @alianazambori ,

Please have a try.

Create a measure.

Dynamic Year Start = 
VAR SelectedCountry = SELECTEDVALUE('Country'[Country])
VAR FiscalYearStart = DATE(YEAR(TODAY()), 1, 1) // Assuming Fiscal Year starts in January
VAR CropYearStartJuly = DATE(YEAR(TODAY()), 7, 1)
VAR CropYearStartApril = DATE(YEAR(TODAY()), 4, 1)
VAR CropYearStartOct = DATE(YEAR(TODAY()), 10, 1)
RETURN
    SWITCH(TRUE(),
        SelectedCountry = "Country1" && [Selection] = "CropYear", CropYearStartJuly,
        SelectedCountry = "Country2" && [Selection] = "CropYear", CropYearStartApril,
        SelectedCountry = "Country3" && [Selection] = "CropYear", CropYearStartOct,
        FiscalYearStart
    )

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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 @alianazambori ,

Please have a try.

Create a measure.

Dynamic Year Start = 
VAR SelectedCountry = SELECTEDVALUE('Country'[Country])
VAR FiscalYearStart = DATE(YEAR(TODAY()), 1, 1) // Assuming Fiscal Year starts in January
VAR CropYearStartJuly = DATE(YEAR(TODAY()), 7, 1)
VAR CropYearStartApril = DATE(YEAR(TODAY()), 4, 1)
VAR CropYearStartOct = DATE(YEAR(TODAY()), 10, 1)
RETURN
    SWITCH(TRUE(),
        SelectedCountry = "Country1" && [Selection] = "CropYear", CropYearStartJuly,
        SelectedCountry = "Country2" && [Selection] = "CropYear", CropYearStartApril,
        SelectedCountry = "Country3" && [Selection] = "CropYear", CropYearStartOct,
        FiscalYearStart
    )

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.