Forum Discussion

giorgiokatr's avatar
giorgiokatr
Icon for Helper V rankHelper V
9 years ago
Solved

sum different columns depending on a slicer selection

I have two tables

 

Date | MTD | QTD | YTD

 

second table is

Selection

MTD

QTD

YTD

 

slicer hav the values of second table

is there any other way than using if to have sum of MTD column of first table when MTD is selected etc?

  • Cool, 

     

    Try this  it will help u, if not let me know.

     

     

     

    Note : 

    If u select multiple option it will move to Others part.

     

6 Replies

  • Baskar's avatar
    Baskar
    Icon for Resident Rockstar rankResident Rockstar

    Cool, 

     

    Try this  it will help u, if not let me know.

     

     

     

    Note : 

    If u select multiple option it will move to Others part.

     

    • giorgiokatr's avatar
      giorgiokatr
      Icon for Helper V rankHelper V

      Cool Baskar! So you create a var in order to avoid writing the if statement inside switch? Thanks!

      • Baskar's avatar
        Baskar
        Icon for Resident Rockstar rankResident Rockstar

        Yes u r correct my friend. Var is more powerfull function in DAX.

         

        It will help u in many situation, and good performance too.

         

        :-)