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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Andreas112
New Member

Issue with sum of two measures

Hi all,

 

I'm just learning PowerBI and Dax and working on my first project...

 

I came up with an issue with two measures, doing  a sum if an order has a certain state.  To exclude any issue with my data model, I made a simple example to solve the issue but I ran into the same problem.

 I have this simple table:

Andreas112_0-1735473072724.png

 

So I want the revenue for type A, I made a measure:   Revenue A =  CALCULATE(SUM('order'[Revenue]), 'order'[Type] = "A")  

The same for order type B.

Putting the measure on a KPI visual or a table visual works fine. Putting both measuares on the table visual I am receivang an error.

 

Summing up both measures (Revenue AB = [Revenue A] + [Revenue B] gives me the same error on the KPI visual.

Andreas112_1-1735473643040.png

 

Maybe that's just a simple newbie problem, any hint is highly appreciated.

 

Thanks

Andreas

8 REPLIES 8
AdamAbberfield
Frequent Visitor

have found i have this exact issue sample pibx from @tharunkumarRTK also gives error same as @Andreas112 

 

i am running Version: 2.139.2054.0 32-bit (January 2025)

v-stephen-msft
Community Support
Community Support

Hi @Andreas112 ,

 

I'm the same as yours, but I reproduced it on my side, and there were no problems.

vstephenmsft_0-1735887006174.png

Have you tried rebuilding every visual with the error to see if they work fine?

 

Best Regards,

Stephen Tao

 

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

 

Hi @v-stephen-msft ,

 

I tried rebuilding everything several times, also testing with older versions.

 

At this point September Version: 2.136.1478.0 32-bit (September 2024) works fine, October and November show the same error.

 

Best Regards
Andreas

 

DataNinja777
Super User
Super User

Hi @Andreas112 ,

 

Using the KEEPFILTERS function ensures that the filter 'order'[Type] = "A" is applied in addition to any existing filters on the Type column, rather than replacing them. If a slicer or other visual already filters the data, this measure will respect those filters, making it more dynamic.

 

Revenue A = CALCULATE(SUM('order'[Revenue]), KEEPFILTERS('order'[Type] = "A"))

 

If you use the required field in the KPI visual, the visual will display correctly. For example, adding the measure Revenue AB = [Revenue A] + [Revenue B] to the Value (Indicator) field ensures the visual has the necessary input to render.

DataNinja777_1-1735478579151.png

 

Having said that, for the case described above, using the order[Type] field on rows, combined with slicers, would be sufficient without the need to write separate measures for each order type.

 

I have attached an example pbix file for your reference. 

 

Best regards,

 

Best regards,

 

 

tharunkumarRTK
Super User
Super User

@Andreas112 

Not sure if there is any gap in my understanding, But it should not give any error if you have created the measures with the correct syntax and if you would have chossen appropriate data types then it should not give any error. For your reference I created the sample report with the data you provided and created the same measures 

Screenshot 2024-12-29 at 6.37.03 PM.png

 

I am attaching the PBIX for your reference 

 

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

Thanks for your answer.

I opened your pbix and got the same errors. Same with @DataNinja777  pbix....

 

Andreas112_0-1735480294773.png

 

I am working an PowerBI Desktop Version: 2.138.1452.0 32-bit (November 2024)

 

Could this be a problem with my options and settings?

 

Thanks 

Andreas

 

@Andreas112 

Strange, I have the same version installed in my machine. May be install the older version and see if that helps

https://learn.microsoft.com/en-us/power-bi/fundamentals/desktop-latest-update-archive?tabs=powerbi-d...

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

@tharunkumarRTK 

I installed March version and everything works as expected.

 

I again downloaded November version, installed it and it doesn't work anymore....really strange.

 

As a workaround I can go back to the March version, hoping that with the next update it will work again.

 

Thanks for your kind help.

Andreas

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors