Forum Discussion

Young_G_Han's avatar
Young_G_Han
Helper III
6 years ago
Solved

var return with Slicers.

Hi. There is a wall that I am facing, I tried to find a solution in your youtube video of Power BI contents creators but not yet having any solution. Please review my problem below and make a conte...
  • Greg_Deckler's avatar
    Greg_Deckler
    6 years ago

    Right but you are still using VAR's and CALCULATE weird. Try this:

     

     

    Quantity sold =
      CALCULATE( 
        SUMX( sales, sales[quantity]), 
        DATESYTD( date[date] ),
        FILTER( product, product[code] = "A")
      )

     

    The other option would be to take your 2 VAR's and turn them into their own measures, then what you are doing with the CALCULATE would make more sense.