Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Slicer multiple selection error

I want to compare day by day revenue based on country and area. I am using below query and getting data only if i select one country or area. when i select multiple country or area i am getting error...
  • v-frfei-msft's avatar
    v-frfei-msft
    8 years ago

    Hi Anonymous,

     

    Based on my test, we can update your formula as below to meet your requirement.

    Revenue D/D = 
    VAR TodayY = CALCULATE(MAX(Revenue[Create Date]),ALLEXCEPT(Revenue,Revenue[Create Date]))
    VAR Yesterday = TodayY - 1
    VAR Revyesterday =
    CALCULATE (
    SUM(Revenue[Total_Revenue]),
    ALLSELECTED(Revenue),FILTER (Revenue, Revenue[Create Date] = Yesterday )
    )
    VAR Revtoday =
    CALCULATE (
    SUM(Revenue[Total_Revenue]),
    ALLSELECTED(Revenue),FILTER ( Revenue , Revenue[Create Date] = TodayY)
    )
    RETURN
    Revtoday – Revyesterday

     

    For more details, please check the pbix as attached.

     

    https://www.dropbox.com/s/e9ydh1nwpbsia9y/Slicer%20multiple%20selection%20error.pbix?dl=0

     

    Regards,

    Frank