Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I'm trying to create a calucted column to calculate season via the DAX formula below but I get error
Season = IF ( 'Date'[MonthNo] >= 9 && 'Date'[MonthNo]<= 12, 'Date'[Year] & "-" & 'Date'[Year] + 1, 'Date'[Year] - 1 & "-" & 'Date'[Year] )
The table look like this.
Solved! Go to Solution.
Hi @okletsgo ,
Based on my test, I did not get any issue here. Are the columns are calculated columns in your formula in your scenario? Then you will get circular dependency error. You can refer to this third - party bolg.
https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/
Btw, please try to use the updated one.
Season = IF ( MONTH('Date'[Datum])>= 9 && MONTH('Date'[Datum])<= 12, YEAR('Date'[Datum]) & "-" & YEAR('Date'[Datum]) + 1, YEAR('Date'[Datum]) - 1 & "-" & YEAR('Date'[Datum]) )
I have a date column, and I wanna create a season column from it.
The date column look like 2016-02-10 and etc.....
The season column I want gonna look like this format below:
2014/2015
2015/2016
2016/2017
Any idea or example how I can do it in Power Query?
If the date column in your file looks like 2016-02-10, then you'll need to change it to be a real date. Power Query will do this automatically if you just change the data type to date. Then it will be 2/10/2016 (US format).
Now you can easily get a new column with the info you need.
=Text.From(Date.Year([Date])) & "/" & Text.From(Date.Year([Date])+1)
You can get fancy with date logic to see if the date is in the 4th quarter or whatever to decide when to switch to a new season, but the above will take any date in 2016 and cause the Season to be 2016/2017.
Be sure you assign that type as Text when done.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi @okletsgo ,
Based on my test, I did not get any issue here. Are the columns are calculated columns in your formula in your scenario? Then you will get circular dependency error. You can refer to this third - party bolg.
https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/
Btw, please try to use the updated one.
Season = IF ( MONTH('Date'[Datum])>= 9 && MONTH('Date'[Datum])<= 12, YEAR('Date'[Datum]) & "-" & YEAR('Date'[Datum]) + 1, YEAR('Date'[Datum]) - 1 & "-" & YEAR('Date'[Datum]) )
Hi @okletsgo
What error are you receiving?
I have just tried your formula and it is working as expected for me
Thanks,
George
User | Count |
---|---|
103 | |
90 | |
78 | |
72 | |
68 |
User | Count |
---|---|
108 | |
96 | |
95 | |
74 | |
71 |