Forum Discussion

Freekh's avatar
Freekh
Frequent Visitor
4 years ago
Solved

Matrix row total not matching values

Hi,

 

I can't seem to calculate the correct weektotal. The values calculated per day are correct and need to be summed per week.

 

This is the formule is use:

 

Below the values which are returned:

 

The total I am looking for is 17+24+13+5+2 = 61

 

Is there a way to calculate this total?

 

  • Try moving your first three variables inside so they are calculated for each date separately.

     

    # Rest Pallets =
    SUMX (
        ADDCOLUMNS (
            SUMMARIZE ( fct_Scanning, dimDate[Date], fct_Scanning[DC] ),
            "RestPallets",
                CALCULATE (
                    VAR Pallets = [...]
                    VAR FTL = [...]
                    VAR WholeFTL = [...]
                    RETURN
                        IF ( [...] )
                )
        ),
        [RestPallets]
    )

2 Replies

  • Try moving your first three variables inside so they are calculated for each date separately.

     

    # Rest Pallets =
    SUMX (
        ADDCOLUMNS (
            SUMMARIZE ( fct_Scanning, dimDate[Date], fct_Scanning[DC] ),
            "RestPallets",
                CALCULATE (
                    VAR Pallets = [...]
                    VAR FTL = [...]
                    VAR WholeFTL = [...]
                    RETURN
                        IF ( [...] )
                )
        ),
        [RestPallets]
    )