Forum Discussion

hamzashafiq's avatar
hamzashafiq
Icon for Kudo Collector rankKudo Collector
4 years ago
Solved

DateDiff is not working with Applied Slicers

Hi,

 

I want to calculate the DateDiff between two dates for each Serial Number or the values selected from Slicers. But it always calculates based on the complete data, not for the values filtered from the slicer. You can see in the screenshot, it says the total datediff in months are 23 but according to the line chart above, it should show 18. 

 

 

  • hamzashafiq , If those are dates remove .date

     

    or you can try like

    measure =
    var _min = minx(allselected(Table), Table[Date])
    var _max = maxx(allselected(Table), Table[Date])
    return

    Datediff(_min, _max, month)

2 Replies

  • hamzashafiq , If those are dates remove .date

     

    or you can try like

    measure =
    var _min = minx(allselected(Table), Table[Date])
    var _max = maxx(allselected(Table), Table[Date])
    return

    Datediff(_min, _max, month)