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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Measure gets duplicated when used in matrix value

Hi, I'd appreciaet your advice

I have 3 SharePoint lists (parent-chil) I pulled them into PBI like a table and created relationship in data model
the $$ amounts are related to parent not the child, so basically users enter their total domain cost and then provide some domain breakdown, but when I create a matrix and a measure of sum, the measure gets duplicated for every single sub domain.

how can I prevent that?

 

userF_0-1657826775808.png

 

 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a measure as follow:

amount = 
var _res=IF (
    MAX ( 'Sub-Domain'[Sub-Domain] )
        = CALCULATE (
            MIN ( 'Sub-Domain'[Sub-Domain] ),
            FILTER (
                ALL ( 'Sub-Domain' ),
                [Parent:Main Table ID] = MAX ( 'Main_Table'[Main Table ID] )
            )
        ),
    CALCULATE (
        SUM ( 'Sub-Domain'[Amount $] ),
        FILTER (
            ALL ( 'Sub-Domain' ),
            [Parent:Main Table ID] = MAX ( 'Main_Table'[Main Table ID] )
        )
    )
)
return IF(ISINSCOPE('Main_Table'[Main Table ID]),_res,SUM('Sub-Domain'[Amount $]
))

The final show:

vyalanwumsft_0-1658211489833.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a measure as follow:

amount = 
var _res=IF (
    MAX ( 'Sub-Domain'[Sub-Domain] )
        = CALCULATE (
            MIN ( 'Sub-Domain'[Sub-Domain] ),
            FILTER (
                ALL ( 'Sub-Domain' ),
                [Parent:Main Table ID] = MAX ( 'Main_Table'[Main Table ID] )
            )
        ),
    CALCULATE (
        SUM ( 'Sub-Domain'[Amount $] ),
        FILTER (
            ALL ( 'Sub-Domain' ),
            [Parent:Main Table ID] = MAX ( 'Main_Table'[Main Table ID] )
        )
    )
)
return IF(ISINSCOPE('Main_Table'[Main Table ID]),_res,SUM('Sub-Domain'[Amount $]
))

The final show:

vyalanwumsft_0-1658211489833.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Don't rely on the implicit measures. Write a custom measure that handles the computations according to your requirements.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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