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

Calculation Error in measure while calculating values for Sum of entire date data and single value

Hi All, 

 

I am new to power bi and I am trying to build a report which has two datasets involved.  data sets are mentioned below. 

1. Long_Term_Data: this data consists of multiple columns for the same date which I need to sum up. 

2. Excel sheet: where I have projected data for the day (Single entry against each date). 

 

I am trying to create a difference between the sum of Long_term_data - Projected data for each date. 

 

Here is the DAX function I tried but it is returning an error: 

 

Column2 minus ALL =
CALCULATE(VALUES('Sheet1'[Column2]) - SUM('MLP_PREDICTION_LONG_TERM'[ALL]))
 
Below is my table and relationships 
 
Long_Term_Data table 
Sam2112_0-1635013492726.png

 

Projected table 

Sam2112_1-1635013555341.png

 

I have Relationship between those tables as below. 

 

Long_Term: Projected data ----> PDate ---->Date  Many to one 

 

Any help is really appreciated 

1 REPLY 1
VahidDM
Super User
Super User

Hi @Anonymous 

 

Understand you want to calculate the difference for each date, so you used the Date in the visual.

try this:

Column2 minus ALL =
MAX('Sheet1'[Column2]) - SUM('MLP_PREDICTION_LONG_TERM'[ALL])
 

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

Appreciate your Kudos!!


 

 

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