The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
@jo123456 Here is a cleaned up version using SWITCH TRUE. Is the goal here to essentially implement a fiscal year flag where the fiscal year starts in September?
YearIndicator1 =
SWITCH( TRUE(),
'D-DATE'[CalendarYear] * 100 + 'D-DATE'[CalendarMonthNum] < (YEAR(TODAY())-1) * 100 + 9, "Before Previous Year",
'D-DATE'[CalendarYear] * 100 + 'D-DATE'[CalendarMonthNum] >=(YEAR(TODAY())-1) *100 + 9 && 'D-DATE'[CalendarYear] * 100 + 'D-DATE'[CalendarMonthNum] <= YEAR(TODAY()) * 100 + 8, "Previous Year",
'D-DATE'[CalendarYear] * 100 + 'D-DATE'[CalendarMonthNum] >= YEAR(TODAY()) * 100 + 9 && 'D-DATE'[CalendarYear] * 100 + 'D-DATE'[CalendarMonthNum] <= (YEAR(TODAY()) + 1) * 100 + 8, "Current Year",
'D-DATE'[CalendarYear] * 100 + 'D-DATE'[CalendarMonthNum] >= (YEAR(TODAY()) + 1) * 100 + 9 && 'D-DATE'[CalendarYear] * 100 + 'D-DATE'[CalendarMonthNum] <= (YEAR(TODAY()) + 2) * 100 + 8, "Next Year",
"Future Dates"
)
starts in september of the current year and always ends in august of the next year
@jo123456 Does seem possible that there should be an easier way to do this. One thing that would help greatly would be to use SWITCH( TRUE(), ... ) instead of the nested IF statements.
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |