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

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

Reply
joepath
Helper II
Helper II

Summarize stop working with Many to Many relationship

Hello,

I have the below measure which was working fine with 1:M relationship, but due to some requirement we need to convert the relationship to M:M.

now the measure stop working because its using SUMMARIZE function, and SUMMARIZECOLUMS is not working because I need to use it in tabular report.

How to convert this meausure so it can work with M:M relationship giving the same result in optimize way.

 

Test = SUMX(
FILTER(
ADDCOLUMNS(
SUMMARIZE(Fact,user[full_name],city[name]),
"@M1",[M1]

),
[@M1]>=1
)
,[@M1]
)

 

Thanks,

1 ACCEPTED SOLUTION

@joepath 

Please try

Test =
SUMX (
CROSSJOIN (
CROSSJOIN ( VALUES ( user[full_name] ), VALUES ( city[name] ) ),
VALUES ( country[country code] )
),
VAR M1 = [M1] RETURN IF ( M1 >= 1, M1 )
)

but this will make it even slower

View solution in original post

11 REPLIES 11
tamerj1
Super User
Super User

Hi @joepath 
Please try

Test =
SUMX (
    FILTER (
        ADDCOLUMNS (
            CROSSJOIN ( VALUES ( user[full_name] ), VALUES ( city[name] ) ),
            "@M1", [M1]
        ),
        [@M1] >= 1
    ),
    [@M1]
)

Thanks @tamerj1 for looking into this, seems working but performance is very slow can we do somthing about it?

And I have 3 col so should do like Crossjoin(values(Full_Name),values(city[name]), Country[code]) ?

 

@joepath 

Please try

Test =
SUMX (
CROSSJOIN ( VALUES ( user[full_name] ), VALUES ( city[name] ) ),
VAR M1 = [M1] RETURN IF ( M1 >= 1, M1 )
)

 

this will save the FILTER iteration but the price is paid by the IF condition. However, most probably it will be faster. 

Tried this one, still taking lot of time to execute.

@joepath 
What is the DAX for [M1] measure?

Its a multiplication of two measure from the Fact table.

@joepath 
And what is the dax fro the two measures?

its simple sum.

@joepath 

Hmm 🤔 

can you please share a screenshot of your data model with relationships and advise which columns that are being summed. 

And third column will be added like this, Crossjoin(values(Full_Name),values(city[name]), Country[code])?

@joepath 

Please try

Test =
SUMX (
CROSSJOIN (
CROSSJOIN ( VALUES ( user[full_name] ), VALUES ( city[name] ) ),
VALUES ( country[country code] )
),
VAR M1 = [M1] RETURN IF ( M1 >= 1, M1 )
)

but this will make it even slower

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.