Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am trying to create a custom column based on calendar date to calculate fiscal quarter but getting EOF error. Kindly help.
FiscalQuarter
=VAR FiscalYearStartMonth = 9 //this line giving error
VAR CurrentMonth = MONTH('YourTable'[CalendarDate])
VAR FiscalYearAdjustment =
IF(
CurrentMonth >= FiscalYearStartMonth,
YEAR('YourTable'[CalendarDate]),
YEAR('YourTable'[CalendarDate]) - 1
)
VAR FiscalMonthAdjusted =
IF(
CurrentMonth < FiscalYearStartMonth,
CurrentMonth + 12,
CurrentMonth
)
VAR Quarter = INT((FiscalMonthAdjusted - FiscalYearStartMonth) / 3) + 1
RETURN
"Q" & Quarter & " " & FiscalYearAdjustment
Solved! Go to Solution.
I was trying to add custom column from power query editor and was getting error.
Then I discarded creating custom column from there and went into report view.
In report view , I went to desired table and added new column. That helped me get rid of error and calculate the quarter successfully.
I was trying to add custom column from power query editor and was getting error.
Then I discarded creating custom column from there and went into report view.
In report view , I went to desired table and added new column. That helped me get rid of error and calculate the quarter successfully.
Hi @Sania-F
Please download the pbix file and go to Power Query and check how I calculate FiscalQuarter
Assuming Fiscal Year start from April and end is March (please change the custom column logic as per your requirement)
So April, May, June - Quarter 1
July, Aug, Sep - Quarter 2
so
https://drive.google.com/file/d/1z4gz5hDIh9QZdfxQXXt-q88Sa9bmXW3l/view?usp=sharing
If solved your requirement, please mark this answer as SOLUTION.
If this comment helps you, appreciate your KUDOS
Thanks
Pijush
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
104 | |
78 | |
68 | |
61 |
User | Count |
---|---|
144 | |
106 | |
106 | |
82 | |
70 |