Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
My solution for replacing blanks with 0 in a measure is normally:
Example measure = var example =
CALCULATE(.......)
return
IF(ISBLANK(example),0,example)
For some reason this doesn't seem to work on a calculated column, is that right? Is there a way round it? Mine consists of a large number of IF statements, where, if all are FALSE, the value should be 0 rather than blank.
Thanks all for trying to help,but I still haven't managed to figure out out. My calculated column is pretty messy as I'm still a Power BI novice, but at least does the trick (....other than replacing (blank) with 0):
Hi @enorberg
does
RETURN
example
returns you a correct result?
In other words, are you sure your CALCULATE() is correct?
check also data type for your column. try text data type and quotas
CALCULATE(.......)
return
IF(ISBLANK(example),"0",example)
Hi @enorberg ,
Not sure on your DAX expression as you haven't shared it. But, you can do something like this.
IF(NOT(ISBLANK(example)), CALCULATE(SUM(salesValue)), 0)
You can modify the above dax with your column names and logic.
Thanks,
Pragati
@enorberg It should work, I don't see the reason why it wouldn't. If you have nested ifs you need to check your logic, the best would be to change if statement to SWTICH which is easy to read and maintain especially when there are many nested ifs.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
103 | |
76 | |
66 | |
63 |
User | Count |
---|---|
142 | |
105 | |
102 | |
81 | |
68 |