Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

One total value in one column

I have a table with various product categories  Category  Previous Sales  Current Sales  Total Sales Socks  2,000   2,000 Hangers 500   500 Pants 20 400 400 Jacket 0 300...
  • v-robertq-msft's avatar
    4 years ago

    Hi, Anonymous 

    According to your description, do you mean that you want to prioritize the current value as the total value and get the total value for each category? I think you can try to create a measure like this:

    Total Sale =
    
    SWITCH(
    
        TRUE(),
    
        MAX('Table'[Current Sales ])<>BLANK(),SUM('Table'[Current Sales ]),
    
        MAX('Table'[Previous Sales ])<>BLANK(),SUM('Table'[Previous Sales ]),
    
        SUM('Table'[Current Sales ]))

    And you can create a table chart like this:

     

    And you can get what you want.

    You can download my test pbix file below

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.