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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
ivanuska
Advocate I
Advocate I

Matrix Incorrect Total

Hi guys,

 

I am having issue with total row in matrix for one of my measure that is calculating 3-month average. If the measure is evaluated on date level, it is showing correct figures - see below graph and also table (on date level). Problem is only in total.

 

I tried to implement HASONEVALUE condition however it did not resolve the issue.

Measure = 
VAR _average = CALCULATE([3-Month Average Invoice Amount USD])
RETURN
IF(HASONEVALUE('Date table'[Date]),
    _average,
        SUMX(VALUES('Date table'[Date]) , _average ))

 

The sum of the first 3 day-averages should sum up to 7.1 mil. (as in graph) and not 5.4 mil. (as in matrix)

ivanuska_0-1689293686626.png

ivanuska_1-1689293807966.png

 

Any help is much appreciated!

Thank you
Ivanuska

1 ACCEPTED SOLUTION
edhans
Community Champion
Community Champion

Try this:

New Measure =
SUMX (
    VALUES ( 'Date table'[Date] ),
    [3-Month Average Invoice Amount USD]
)


That will at the total level take the sum of the 3 averages of each day.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

1 REPLY 1
edhans
Community Champion
Community Champion

Try this:

New Measure =
SUMX (
    VALUES ( 'Date table'[Date] ),
    [3-Month Average Invoice Amount USD]
)


That will at the total level take the sum of the 3 averages of each day.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.