Forum Discussion

vikramsharma18's avatar
vikramsharma18
Frequent Visitor
4 years ago
Solved

Data Comparision from two date slicer

One slicer date is random and compare slicer is just 30 days or 1 month back from the selection.
how will we archive it in power bi?

  • Hi, vikramsharma18 

     

    Need 2 unrelated date tables to control 2 different date slicers. I have simulated some data that I hope will fit your situation.

    Table:

    Date = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

    Measure:

    Sum1 = SUM('Table'[Value])
    Sum2 = 
    CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Date]>=MIN('Date'[Date])&&[Date]<=MAX('Date'[Date])))
    Measure = IF(MIN('Date'[Date])>=MIN('Table'[Date])+30,1,0)

    In this case, the 2nd slicer can only display the date 30 days after the first slicer.

    As shown in the figure, 2 slicers control 2 values separately and can be compared.

     

    Best Regards,

    Community Support Team _Charlotte

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

2 Replies

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

    Hi, vikramsharma18 

     

    Need 2 unrelated date tables to control 2 different date slicers. I have simulated some data that I hope will fit your situation.

    Table:

    Date = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

    Measure:

    Sum1 = SUM('Table'[Value])
    Sum2 = 
    CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Date]>=MIN('Date'[Date])&&[Date]<=MAX('Date'[Date])))
    Measure = IF(MIN('Date'[Date])>=MIN('Table'[Date])+30,1,0)

    In this case, the 2nd slicer can only display the date 30 days after the first slicer.

    As shown in the figure, 2 slicers control 2 values separately and can be compared.

     

    Best Regards,

    Community Support Team _Charlotte

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