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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
montana310
New Member

Subtracting 2 columns shows incorrect values for blank records - Power Pivot

Hi!

I have a simple a data source that includes product names, sale dates and amounts - pelase find the below data sample with dummy data:

NamedateValue
test01.10.20231000
test01.10.202310030
test_101.11.202310004
test_101.11.202312000
test_201.10.20233452
test_201.11.202354000

 

I have loaded the source data to Data Model in Excel and created a power pivot. As a final step, I want to present the difference between November's and October's values for each product name, therefore I have created DAX messure with the code below:

var current_date = max(Tabela1[date])

var oct_amount=
CALCULATE(

[AMT];

Tabela1[date]=date(2023;10;1)

)

var nov_amount=
CALCULATE(

[AMT];

Tabela1[date]=date(2023;11;1)

)

return

if(current_date=date(2023;10;1);

BLANK();

nov_amount - oct_amount)



The messure shows correct values only for products that have had orders in November and does not read blank values as zero - the incorrect delta value is highlighted in red:

montana310_0-1699187568386.png

 

The ISBLANK function also shows a blank result for non-value records:

montana310_1-1699187986693.png

 

The data sample is available at the link

I would be grateful for any suggestions how to cope with this issue.




1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

There's an important, profound technology call "Auto-Exist" under the hood. You may want to refer to this article for further understanding.

Understanding DAX Auto-Exist - SQLBI



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

1 REPLY 1
ThxAlot
Super User
Super User

There's an important, profound technology call "Auto-Exist" under the hood. You may want to refer to this article for further understanding.

Understanding DAX Auto-Exist - SQLBI



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.