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
Anonymous
Not applicable

Difference column error

Hello,

This table refers to a real project that receives new data on a daily basis, I created a measure to calculate the difference as shown in the example below, but when my real cumulative is 0, the difference is set to null, but in my measure I specify which is to treat this case only if my real accumulated is null. If it is 0 it should do a normal subtraction, but it is not happening.

nulo.PNGThe table works as follows: daily data is inserted in this table, the PLAN field is completely filled in early in the day, while the REAL is filled according to the current time, if we are, for example, at 9 am, the data in the REAL and DIFF fields in the fields below must be null and only the PLAN field must be filled in, as shown in the example below.

Capturar.PNG

In summary, with the measure seen in the first image, I manage to deal with the case that the real accumulated is null, but he is doing the same treatment for 0 when it should make a simple sum. Can anyone help?

5 REPLIES 5
v-easonf-msft
Community Support
Community Support

Hi , @Anonymous 

Not very clear what happened.

 When using the following measure,does the same problem occur?

 

DIFF =[REAL] - [PLAN] )

 

 

If help ,take a  try of  this measure please:

 

DIFF =
IF ( ISERROR ( [REAL] - [PLAN] ), BLANK (), [REAL] - [PLAN] )

 

 

If it doesn't work please show me the result /or detail  error message

 

Best Regards,
Community Support Team _ Eason

 

 

Anonymous
Not applicable

@v-easonf-msft hi, this measure: 

DIFF =[REAL] - [PLAN] )

It works partially, but when doing this, I have a difference from all the displayed times, and in this case I must show the differences only until the current time.

For example, in this case:

Capturar.PNG 

I have REAL data until 10am and therefore I must have DIFF by 10am too, but with this measure above, it sets all DIFFs even if there is no REAL (null). The current problem is when I have a REAL with a value 0, because it is considering that my REAL is null and is putting null in the DIFF as well, because my current measure is:

DIFF = IF([**bleep** REAL] = BLANK(), BLANK(), [**bleep** REAL] - [**bleep** PLAN])

 

amitchandak
Super User
Super User

@Anonymous , Not very clear you can create a new column like this

table[plan] - maxx(filter(table,table[plan]<earlier(table[plan])),table[plan])

Anonymous
Not applicable

@amitchandak It doesn't work, both PLAN and REAL are measures used to make an accumulated sum. However, in some way or power, the bi is not differentiated between zero and null, because as you can see the measure that I put in the attachment I request that the diff receives null only if REAL is null, then that null it will also be displayed null.

@Anonymous  check isblank(Table[REAL]) that should give you true for blank

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.

Top Solution Authors