Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi
I have the following scenario
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
Solved! Go to Solution.
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.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
126 | |
78 | |
78 | |
59 | |
51 |
User | Count |
---|---|
164 | |
84 | |
68 | |
68 | |
58 |