Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi there, I had some help me get to this formula
I've made a date table in power query and I'm looking to add a fiscal year column in the format 2023-24
if (Date.Month([Date])) <=3 , number.ToText(Date.Year([Date])) & "-" & Text.End(Number.ToText(Date.Year([Date])+1),2)) , Number.ToText(Date.Year([Date])+1) & "-" & Text.End(Number.ToText(Date.Year([Date])+2),2))
However it gives me the error "Token 'then' expected", could someone help me figure this out?
Solved! Go to Solution.
I think you might be mixing up the DAX syntax with Power Query syntax on this. To debug, simplify the code, use dummy values until you get it to work, then introduce the more complex code.
Start with this
if Date.Month([Date]) <=3 then "a" else "b"
I think you might be mixing up the DAX syntax with Power Query syntax on this. To debug, simplify the code, use dummy values until you get it to work, then introduce the more complex code.
Start with this
if Date.Month([Date]) <=3 then "a" else "b"
| User | Count |
|---|---|
| 57 | |
| 43 | |
| 32 | |
| 16 | |
| 13 |
| User | Count |
|---|---|
| 84 | |
| 70 | |
| 37 | |
| 27 | |
| 24 |