The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a column with some values containing Negatives and "NAH"
How can i turn those negative numbers and "nah to 0
that is, anytime the result in this column show a negative value or "nah" ti should automatically convert it to 0
you have to do it in power query and for that you need to click
pls try this
if
Number.IsNaN([Sales]) or [Sales]<0
then 0 else [Sales]
It didnt work for me.
I have a table with 5 columns spooled from a source. So i added "sales" Column to the table.
Sales Column is the result of the calculation of ColumnA divided by 2
So what I want is, how to turn "Nah" and all the negative numbers(See Screenshot below) to Zero (0)
Hi,
Assuming the Sales column was created in the Query Editor AND you want to get the desired result in the Query Editor itself, write this Custom column formula in the Query Editor
=if [Sales]="NaH" or [Sales]<0 then 0 else [Sales]
If you want to get the resutl in the Data Model, then write this calculated column formula
=if(or(Data[Sales]="Nah",Data[Sales]=0),0,Data[Sales])
Hope this helps.
Hi,
Does this calculated column formula work?
if(or(Data[Sales]="Nah",Data[Sales]="0"),0,Data[Sales])
Hi,
Share the download link of the PBI file with the formula already written (the one that yields an error).
thanks @Ahmedx , I cant see Custom Column
I clicked new column, and enter the code above, gives error
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
82 | |
62 | |
54 | |
51 |
User | Count |
---|---|
127 | |
118 | |
81 | |
66 | |
65 |