Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
3 years ago

Total sum

Hello

I have a visual that is not making me the total I expect.

if I have the typical measure of "Sale500= sale + 500"

It shows me:
CHANNEL sale Venta500

one 10 510

of 30 530

three 40 540

TOTAL 80 580 (should be 1580 )

I am not worth the sumx (allselected (CHANNEL), Venta500), since I want a measure where I can change CHANNEL, by CATEGORY, COUNTRY, etc ...

Thanks in advance for the answer...

1 Reply

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

    Hi MateoPBI 

     

    I think the "sale" measure is a simple measure like SUM('Table'[sales]), right? In this case I'm afraid you have to use SUMX function to get the correct total value for CHANNEL. You can use 

    Sale500 = SUMX ( VALUES ( 'Table'[CHANNEL] ), [Sale] + 500 )
    

     

    When you look at totals and subtotals, remember that those values are based on the underlying data. They aren't solely based on the visible values. So with your old "Sale500= sale + 500", the [sale] is evaluated first for the total row, then it adds 500 to the total value. It isn't just a simple addition of the values in the visible or displayed rows. Understanding how Power BI calculates totals

     

    If you want to change CHANNEL, by CATEGORY, COUNTRY, etc ... you need to create multiple measures with the same structure. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.