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

Measure gives wrong total values

I have 2 tables with data, for which I want to match the totals of Data B when the row on Data A is > 0. The measure I figured would work, only works on row level, but not on totals.

 

Measure= IF(SUMX(Data A;Data A[Values]) > 0;SUMX(Data B;Data B[Values]))
TKA_0-1620396526381.png

Result 24.496, expected value 19.054.

 

Why does this happen, what am I missing here? Ideally I'd just "SUMIF" on date and itemID from A to match values with B, but I couldnt find an Excel equivalent for DAX that worked for me.

 

Perhaps a calculated column would probably be better, but both datasets are detailed differently. Is there perhaps a way to create a new table, totaling on itemID + date from both tables (ideally with Data A being the generator of the itemID's)?

 

3 REPLIES 3
Anonymous
Not applicable

Just going to bump this topic one time in hopes of a solution, otherwise I'll probably have to try and fix it in SQL instead.

 

Could this be considered a bug, or is this the subtotal a result of me using the wrong formula?

Anonymous
Not applicable

@amitchandak When I use your measure, I have 2 options for the itemID. The one from data A or my table that links the 2 itemid's together. However, both seem to do the same thing in the totals:

 

Using the ItemID-link table:

TKA_0-1620631889616.png

 

Using the ItemID from table A:

TKA_1-1620631929070.png

 

EDIT: In case it is important to mention, there are other filters on this page (date/category). I do get different results if I change the category or remove it completely, but the results act in the same way.

 

TKA_2-1620632249417.png

 

 

amitchandak
Super User
Super User

@Anonymous , Try measure like

 

Measure= Sumx(values(Table[Item ID]) IF(SUM(Data A[Values]) > 0;SUM(Data B[Values]), blank()))

 

use correct table for item id

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.