Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Akshay123
Regular Visitor

How to replace 0 values to measure

Hi Experts

 

I have data like below and it's direct fields from the source, I have created measures for Jan to Dec months.

If flaw_cnt is blank or 0 value need to replace it with my particular month measure or if it is <> 0 or Blank it has to load the actual value.

 

Akshay123_0-1713524152404.png

 

5 REPLIES 5
v-tangjie-msft
Community Support
Community Support

Hi @Akshay123 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1713768094941.png

(2) We can create a measure. 

New Measure = IF(SUM('Table'[flaw_cnt])= BLANK() ||SUM('Table'[flaw_cnt])=0,[Yourmeasure],SUM('Table'[flaw_cnt]))

(3) Then the result is as follows.

vtangjiemsft_1-1713768167739.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. 

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Kedar_Pande
Regular Visitor

FLAW_CNT_REPLACE= if(flaw_cnt=blank() || flaw_cnt=0, [Your measeure for months],flaw_cnt)

Let me know if this helps

Hi @Kedar_Pande 
Thanks for your response, it will not work.
My appoach I am looking, I need to validate all the months and return the value

for ex :
var a = if(month = 1, sum(flaw_cnt) 
var b = if(month = 2, sum(flaw_cnt)

.

.

.

var c =  if(month = 12, sum(flaw_cnt) 

 

Return

if (a = 0, My measure, a)
But i am unable to return all months value

 

Hi @Akshay123 ,
How month and flaw_cnt is related?
Can you share the pbix file?


Hi @Kedar_Pande 

 

Can't attach any files here, I have some limitations.
It's just like sales amout, which month how much of sales happend.

Till April have data, rest of the months are preductive count.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.