Forum Discussion

BuckedUpJJP's avatar
BuckedUpJJP
New Member
1 year ago

Total Row Miscalculation

I have an issue with my measure calculating properly for my total when I add my measure to my matrix visual. I can't figure out why its not calculating properly as my total is 267,341,999 when it should be 271,499,454. 

If you were to add each row's months together you will get a different total than what is displayed. For example, row 1 the total displayed shows 13,790,209 but when manually adding together Jan - Dec for row 1 you get 14,000,001.

When you manually add together the total row for each month (Jan - Dec) you get 271,499,454 but the visual displays 267,341,999.

 

 

 

Example data tables to help me in solving this issue.

Dim_Budget table: https://drive.google.com/file/d/1StViE09SQLuoE2qLoM3oSKua4jgr8WU9/view?usp=drive_link

Dim_Dates Table: https://drive.google.com/file/d/1_41UfZCCHE5BJFVc4a0Pbx7LM8fyfDFp/view?usp=drive_link

 

This is the measure I am using. The dataset is only showing Gross Revenue in my budget table but I have other categories which is why I have the measure filtering for just "Gross Revenue"

Daily Budget =
DIVIDE(
    CALCULATE(
        SUM(dim_budgets[Value]),
        dim_budgets[Budget Account] = "Gross Revenue"  -- Filter for Gross Revenue
    ),
    CALCULATE(
        COUNTROWS(dim_dates),
        ALL(dim_dates),
        dim_dates[Month] = MAX(dim_budgets[Month]) &&
        dim_dates[Year] = MAX(dim_budgets[Year])
    )
)