Forum Discussion
DAX if statement query
I have this set up which is currently pulling data from excel. I want the data and words to change when I refresh instead of having to type it out.
So I'm using the following for the above box to change the box above to say Increased by or decreased by. The 39.49% is another card which is pulling from data field I have called Total_NDD_WOW. I created the following measure for the wording to change.
NDD_IF = IF(sum(Data[Total_NDD_WOW]) <0, "decreased by", "increased by")
Problem is, if the %age number is a negative e.g. -39.49%, it still shows as "increased by". It only shows "decreased by" if I swap the wording around in the DAX i.e. NDD_IF = IF(sum(Data[Total_NDD_WOW]) <0, "increased by", "decreased by")
Wanted to know the best way to fix this without having to change the code over everytime.
Thanks
2 Replies
- lbendlinSuper User
is Total_NDD_WOW a measure or a (calculated) column? What made you choose "sum" ?
- AnonymousNot applicable
Hi Abz_17 ,
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng