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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
christinaxxx
Helper I
Helper I

Incorrect subtotals in matrix visual

I'm calculating the run rate for sales managers to project how many onboarded customers have placed an order on an ecom app at the end of a period. The start of period (Date_initialised) for each sales manager is different but the end of period is the same. The DAX measure per sales manager is correct, but it won't aggregate to higher hierarchical levels (I have multiple hierarchical levels e.g., suburbs, regions) in the matrix visual. My DAX is as below:

 

 

 

CurrentRunRate = 

VAR Last_update = MAX(Fact_Weekly[full_date])

VAR Date_initialised = SELECTVALUE(Fact_DateInitialised[Date Initialised])

VAR Days_gone = DATEDIFF(Date_initialised, Last_update, DAY)

VAR End_of_period = DATE(2023,11,2)

VAR Days_in_period = DATEDIFF(Date_initialised, End_of_period, DAY)

VAR Avg_per_day = 
IF(
    DATEDIFF(Last_update, End_of_period, DAY) > 0,
    DIVIDE(
        [Have Ordered],  /*<-- SUM(Dim_customer_detail[Have Ordered (1/0)])*/
        Days_gone
    )
)

Return
    Avg_per_day * Days_in_period

 

 

 

 

I later replaced 

 

 

 

VAR Date_initialised = SELECTVALUE(Fact_DateInitialised[Date Initialised])

 

 

 

with 

 

 

 

VAR Date_initialised = MAX(Fact_DateInitialised[Date Initialised])

 

 

 

Although there are values in the subtotals and totals, they are incorrect (snip below, all the blues are subtotals). For example, I want 90+100=190 not 198.

christinaxxx_0-1695243927665.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@christinaxxx , Create a new measure on top of current measure

 

Sumx(Values(Table[Manager]), [CurrentRunRate])

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@christinaxxx , Create a new measure on top of current measure

 

Sumx(Values(Table[Manager]), [CurrentRunRate])

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

Brilliant! Thank you so much! I did try this but I created a SUMX inside my original DAX after RETURN.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors