Forum Discussion

cheid_4838's avatar
cheid_4838
Helper IV
10 months ago
Solved

Grand Total Not Summing Correctly

I am trying to calculate % of Lines Per Week, but I am having trouble getting the Line Count Per Week to sum to 2,355 when I roll the total up to one line.  I get the correct percentages when go down to the week and stop levels (2nd & 3rd screenshot), but when I roll to show one line the Line Count Per Week is not summing correctly. which I need it to do to show the correct allocation of spend in total.  I tried two different methodologies, but neither is working.  Any suggestions for getting this total to sum correctly at a top level versus the detail shown in 2nd of 3rd screenshots?  Thanks.

 

 

 

 

 

 

 

 

 Line Count Per Week =
VAR _Invoice = MAX(STOPS[Start of Week])
VAR _Facility = MAX(STOPS[Facility])
VAR _RETURN = CALCULATE(SUM(STOPS[Total Stops]),FILTER(ALL(STOPS),STOPS[Start of Week]=_Invoice && STOPS[Facility]=_Facility))
RETURN
_RETURN
 
 
 Line Count Per Week =
VAR _Invoice = MAX(STOPS[Start of Week])
VAR _Facility = MAX(STOPS[Facility])
VAR _RETURN =FILTER(ALL(STOPS),STOPS[Start of Week]=_Invoice && STOPS[Facility]=_Facility))
RETURN
SUMX(_RETURN, Stops[Total Stops])
 
 
 
  • % of Lines Per Week = //Try this might help you
    DIVIDE (
        SUMX (
            SUMMARIZE (
                STOPS,
                STOPS[Start of Week],
                STOPS[Facility],
                "Stops", SUM ( STOPS[Total Stops] )
            ),
            [Stops]
        ),
        CALCULATE (
            SUMX (
                SUMMARIZE (
                    STOPS,
                    STOPS[Start of Week],
                    STOPS[Facility],
                    "Stops", SUM ( STOPS[Total Stops] )
                ),
                [Stops]
            ),
            REMOVEFILTERS ( STOPS )
        )
    )
    

3 Replies

  • % of Lines Per Week = //Try this might help you
    DIVIDE (
        SUMX (
            SUMMARIZE (
                STOPS,
                STOPS[Start of Week],
                STOPS[Facility],
                "Stops", SUM ( STOPS[Total Stops] )
            ),
            [Stops]
        ),
        CALCULATE (
            SUMX (
                SUMMARIZE (
                    STOPS,
                    STOPS[Start of Week],
                    STOPS[Facility],
                    "Stops", SUM ( STOPS[Total Stops] )
                ),
                [Stops]
            ),
            REMOVEFILTERS ( STOPS )
        )
    )
    
  • v-priyankata's avatar
    v-priyankata
    Community Support

    Hi cheid_4838 

    Thank you for reaching out to the Microsoft Fabric Forum Community.

    mh2587 Thanks for the inputs.

    I hope the information provided by user was helpful. If you still have questions, please don't hesitate to reach out to the community.

    • v-priyankata's avatar
      v-priyankata
      Community Support

      Hi cheid_4838 

      I wanted to check if you had the opportunity to review the information provided by user. Please feel free to contact us if you have any further questions.