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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
jaap_olsthoorn
Advocate II
Advocate II

SUMX issue when having the same filter in the filters and in the table

Hi all!

 

Sorry for the title, I just have no good way of explaining this issue. Example file at the bottom:

 

I have a table like this: 

jaap_olsthoorn_0-1663061245948.png

LP is the lowest granularity. MLP is the "master" LP. So 2 LP's can be part of 1 MLP.
Recovery is a value that is stored on each row of this table, but when summing it, you are only supposed to take it once for each value of MLP, not for each value of LP.
Finally, I create a random filter, something that splits the rows. I dont really care about this filter, but I need it to trigger my issue.

 

I created this measure: 

test recovery =
SUMX(
    VALUES('Test Table'[MLP]),
    CALCULATE(MAX('Test Table'[Recovery]))
)

The idea being using MLP as the iterator while calulating the max of recovery for each MLP, and then summing those amounts.

I then create the following table, with these filters:
jaap_olsthoorn_1-1663061514142.png

The result is exactly as expected. The total works, the values work, great.

 

Then I filter on the owner babymarkt:

 

jaap_olsthoorn_2-1663061635192.png

 

Still perfect results. 

 

Now I'm going to filter on my random filter that should, as far as I understand it, have no effect, because all rows of babymarkt have filter value 1:

 

jaap_olsthoorn_3-1663061700707.png

The totals rows are still correct, but the individual MLP rows are no longer, and now show the totals too.
When I remove the filter on Owner, the results are as expected again.

 

Something seems to be happening with the owner filter. When I filter for owner only through the row context, it works fine, but when I filter through both the row and filter context, it messes up somehow once I add any other filter.

 

Does anyone have any clue as to what is happening here and how I should fix my measure?

Thanks! 

https://drive.google.com/file/d/1lc-GdEEYAMYjqrm1YfVm9wuWE9Ls_gRq/view?usp=sharing

6 REPLIES 6
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

@jaap_olsthoorn | @amitchandak - Adding this here as well based on this support ticket:

SUMX producing wrong result when filtered in both ... - Microsoft Power BI Community

test recovery =
SUMX (
    SUMMARIZE (
        'Test Table',
        'Test Table'[MLP],
        "Max", MAX ( 'Test Table'[Recovery] )
    ),
    [Max]
)

 

DarylLynchBzy_0-1664289640950.png

 

v-xiaotang
Community Support
Community Support

Hi @jaap_olsthoorn 

Thanks for reaching out to us.

if each MLP has 2 duplicate value, then you can try the 2 measures,

Measure 1 = MAXX(FILTER(ALL('Test Table'),'Test Table'[MLP]=MIN('Test Table'[MLP]) && 'Test Table'[Owner]=MIN('Test Table'[Owner])),[Recovery]) 
Measure 2 = IF(ISFILTERED('Test Table'[MLP]),[Measure 1],SUMX('Test Table',[Measure 1])/2) 

vxiaotang_0-1663667249290.png

 

 

Best Regards,

Community Support Team _Tang

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

No unfortunately that is not an assumption I can make there can be many of the same ones. Although I love the fact that people are trying to help me fix my measure, that's not really what I'm after. I think I found a bug in DAX, and would like to either get a confirmation that this is indeed a bug or an explanation of why it is not a bug.


jaap_olsthoorn
Advocate II
Advocate II

Anyone else have any idea why this is happening? Is there a bug in SUMX?

amitchandak
Super User
Super User

@jaap_olsthoorn , Try a measure like

 

test recovery =
SUMX(
Summarize('Test Table'[MLP],,'Test Table'[owner] ,'Test Table'[Recovery]), [Recovery])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks! That defo works in this example. I'm a bit worried about applyying this to my data model containing many columns though. But I can try!

 

Do you happen to know why the original measure does not work? I'd like to understand what I'm doing wrong. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors