Forum Discussion

UNLOCK49's avatar
UNLOCK49
Regular Visitor
2 years ago
Solved

Runnig Total as Row

Is it possible to display a cumulative total as a row instead of a column?”,  example  in this table i have a "TOTAL" row and a "CUMULAITVE TOTAL"

 202120222232024
CONCEPTO11051510
CONCEPTO2201026
GRAND TOTAL30151716
CUMULATIVE TOTAL 30456278
  • Hi,

    I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.

     

     

     

     

    expected result: =
    IF (
        HASONEVALUE ( category[category] ),
        SWITCH (
            SELECTEDVALUE ( category[Index] ),
            3,
                CALCULATE (
                    SUM ( data[value] ),
                    REMOVEFILTERS ( category[category], category[Index] )
                ),
            4,
                CALCULATE (
                    SUM ( data[value] ),
                    REMOVEFILTERS ( category[category], category[Index] ),
                    WINDOW ( 1, ABS, 0, REL, ALL ( 'year'[year] ), ORDERBY ( 'year'[year], ASC ) )
                ),
            SUM ( data[value] )
        )
    )
    

     

     

1 Reply

  • Hi,

    I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.

     

     

     

     

    expected result: =
    IF (
        HASONEVALUE ( category[category] ),
        SWITCH (
            SELECTEDVALUE ( category[Index] ),
            3,
                CALCULATE (
                    SUM ( data[value] ),
                    REMOVEFILTERS ( category[category], category[Index] )
                ),
            4,
                CALCULATE (
                    SUM ( data[value] ),
                    REMOVEFILTERS ( category[category], category[Index] ),
                    WINDOW ( 1, ABS, 0, REL, ALL ( 'year'[year] ), ORDERBY ( 'year'[year], ASC ) )
                ),
            SUM ( data[value] )
        )
    )