Forum Discussion
Conditional Column in Dax not calculating as expected
- 4 years ago
Gdibbs , a couple of things:
1) M is case sensitive and spelling counts. You've written two different things:
- [Plant]] = "AS5A"
- "plant" is equal to "US5A"
Which option do you want? A or U?
2) It's difficult to see with your screenshots, as you haven't included the columns in one shot, but the example you did show does not appear to have any data < 1, so that will leave everything as blank (not null - if you want null you need to specify that in your column instead of the empty quotes "").
= Table.AddColumn(#"Filtered Rows", "Custom", each if [[Plant]] = "AS5A" and ([[#"Oct-21"]] < 1) then ([#"Oct-21"] * -1) else null)Otherwise I can't see any obvious errors at a quick glance.
v-kelly-msft I have unmarked this as the accepted solution, as it appears that AllisonKennedy & Gdibbs are in the process of working thru this.
Gdibbs please let us know if you need anything else, or if you have the solution that you need. Then please mark as "Accepted as Solution". Super Users in the community are here to assist you as well as Community Support. We just want to make sure that you are finding your answers here in the community.
Thank you for being part of the Power BI Community.
Best,
Heather H
Community Manager
Power BI