Forum Discussion

PatP's avatar
PatP
Frequent Visitor
8 years ago
Solved

Most recent and oldest data within a specific time range using a slicer

Hi!   I’m trying to do a Push notification report with Power BI Desktop, but I can’t get what I want.   I have two tables:   1-A table with the split of device type per month (iOS vs Android) a...
  • ChandeepChhabra's avatar
    8 years ago

    Hey PatP,

     

    How would you define last entry. If the 2 sends are done on extactly the same time and date, which one should be considered the last?

     

    If you would like to pick the maximum of them then replace the SUM with MAX in the 2 measures 

     

    Last Sent = CALCULATE(MAX(Push_Sent[App notification sends]),FILTER(Push_Sent,Push_Sent[Date sent]=MAX(Push_Sent[Date sent])))

     

    First Sent = CALCULATE(MAX(Push_Sent[App notification sends]),FILTER(Push_Sent,Push_Sent[Date sent]=MIN(Push_Sent[Date sent])))