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
obriaincian
Resolver I
Resolver I

Matrix sum of values not correct

I have a calculated table that calculates the amount of time the expiry date changes per SKU.

 

<DistinctMDDCrtExpiryDates =
SUMMARIZECOLUMNS('Data'[Data.SKU],"Change in Expiry Date",
CALCULATE(DISTINCTCOUNT('Data'[Data.Expiration Date]),'Data'[Expiration Date]<>BLANK()))>
 
The issue I'm experiencing is when I create a matrix it shows the total number of changes across the board for each SKU rather than the total number of changes per SKU.
e.g. Below we should not be seeing 744 (this is the total number of changes), what we should be seeing is the 744 should be split out amoung the 4 SKUs.
 
 

obriaincian_1-1646834965992.png

 

 

Some of the matrix is blocked out for confidentiality purposes.

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @obriaincian ,

 

According to your statement, I know that you have a hierachy level in your matrix visual. Is [...Segment] column in "Data" Table? I think you don't need to create a calculated table to aggregate value. Try to use virtual table in measure.

My Sample:

1.png

Measure:

Measure = 
VAR _SUMMARIZE = 
SUMMARIZE (
    Data,
    Data[Segment],
    'Data'[Data.SKU],
    "Change in Expiry Date",
        CALCULATE (
            DISTINCTCOUNT ( 'Data'[Data.Expiration Date] ),
            'Data'[Expiration Date] <> BLANK ()
        )
)
RETURN
SUMX(_SUMMARIZE,[Change in Expiry Date])

Result is as below.

1.png

 

Best Regards,
Rico Zhou

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @obriaincian ,

 

According to your statement, I know that you have a hierachy level in your matrix visual. Is [...Segment] column in "Data" Table? I think you don't need to create a calculated table to aggregate value. Try to use virtual table in measure.

My Sample:

1.png

Measure:

Measure = 
VAR _SUMMARIZE = 
SUMMARIZE (
    Data,
    Data[Segment],
    'Data'[Data.SKU],
    "Change in Expiry Date",
        CALCULATE (
            DISTINCTCOUNT ( 'Data'[Data.Expiration Date] ),
            'Data'[Expiration Date] <> BLANK ()
        )
)
RETURN
SUMX(_SUMMARIZE,[Change in Expiry Date])

Result is as below.

1.png

 

Best Regards,
Rico Zhou

 

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

 

amitchandak
Super User
Super User

@obriaincian , if you created a table and displaying it, with some other tables. This new table should be joined with those tables. I doubt that here.

 

If this does not help
Can you share sample data and sample output in table format?

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

Hi @amitchandak ,

Thank you for your response, I can't merge the created table back to the original table as I have grouped SKUs in the table I created, can you please suggest how I might go about this?

 

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.