Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I am trying to do an if statement in DAX. I want to say if the date is = 2018, then use this other calculation, else do another separate calculation. The data starts in 2018 and the rules change for every year after that. So I need one set of logic to sum the 2018 and another for everything after. I am doing this for Tax purposes and we always need a beginning balance to calculate down to an ending balance. Which will become the beginning balance the following year.
Though the initial validation step in the if statement where I say "if time period equals 2018" it does not like the syntax. I can use the same exact syntax in a Calculate SUM formula - and the Year (xxxxxxx) ="2018" works fine.
What I am seeing is below. I call out the table and field, ask it to look at only the year, then validate. It works in one context but not the other.
I have no idea why in the context of the If statement that is failing. The time period field is formatted as a date.
Any help here is greatly appreciated.
Thanks,
WV
Solved! Go to Solution.
Hi @WV ,
You need get one date value from the field first for year(). Try this:
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @WV ,
You need get one date value from the field first for year(). Try this:
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
9 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
11 | |
3 | |
2 | |
2 | |
2 |