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
Mareias
Frequent Visitor

Sum of a calculated measure column

Hello,

 

I have a table like the one below, where I have created the column Dif and DIf*Vol. However, when I try to see the total of the column Dif*Vol, it doesnt show the grand total. Instead, he does the same calculation as the other lines. All I want is to have a big number showing the real difference.

 

Important to note: The B column is a calculated measure and therefore is dynamic. Therefore, I cant edit the data source and do it directly in the database.

 

SourceAB (Calc Measure)VolumeDif (A-B)Dif *Vol
Z110010703030900
Y110010803020600
M110010903010300
N110010903010300
J11001000301003000
 5500533015017025500

 

The red number should be 5100 - the sum of the lines above.

 

The ideal scenario was to calculate this column directly in the database instead of creating a calculated measure. However, the B column is dynamic and can be changed based on a parameter table. 

 

How can I do that?

 

Thank you.

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hello @Mareias

 

You should use SUMX to iterate over Source and sum the values of Dif*Vol.

Try creating a measure that looks something like this:

=
SUMX ( 
    VALUES ( YourTable[Source] ),
    [Dif*Vol]
)

I'm assuming [Dif*Vol] is a measure. You could also replace [Dif*Vol] with the components of the calculation as long as they are measures (or wrapped in CALCULATE).

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

Hello @Mareias

 

You should use SUMX to iterate over Source and sum the values of Dif*Vol.

Try creating a measure that looks something like this:

=
SUMX ( 
    VALUES ( YourTable[Source] ),
    [Dif*Vol]
)

I'm assuming [Dif*Vol] is a measure. You could also replace [Dif*Vol] with the components of the calculation as long as they are measures (or wrapped in CALCULATE).

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

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.