Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PatP
Frequent Visitor

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) and with the % of devices with the push enabled that look like this :

 

Date

Device Family

Unique Devices

Opted In Users

Opted Out

Uninstalled

2018-04-01

android

65000

0

40000

31000

2018-04-01

ios

130000

51000

45000

15000

2018-03-01

android

105000

0

60000

66000

2018-03-01

ios

150000

85000

65000

51000

 

 

2-A table with a list of the push sent during the month with the number of devices that received the notification and opened it. The table look like this :

 

Push messageDate sentTargetTarget typeApp notification sendsDirect app open
Alert 118-03-29Area 11100 00050000
Alert 218-03-29Area 2199 00049500
Alert 318-03-29Area 3184 56242281
Alert 418-03-29Area 41321 651160826
Alert 518-03-30Area 4216181
Alert 618-03-30Area 52231 316115658
Alert 718-03-31Area 11516258
Alert 818-03-31Area 2151 61625808
Alert 918-03-31Area 1116 5158258
Alert 1018-03-31Area 21321 684160842
Alert 1118-04-01Area 1335 16517583
Alert 1218-04-02Area 23213 516106758
Alert 1318-04-03Area 33231 665115833
Alert 1418-04-04Area 4321 66610833
Alert 1518-04-05Area 5329 66214831
Alert 1618-04-06Area 1169 46334732
Alert 1718-04-07Area 2251 96825984
Alert 1818-04-08Area 31684 651342326
Alert 1918-04-09Area 42655 161327581
Alert 2018-04-10Area 3168 43234216

 

 

What I did and that is working right now :

-A matrix displaying the count of Push message per Target (rows) per Target type (column).
-Another table displaying the unique devices by device type (rows) per month (column).

 

What I try to do : A matrix (or table) that will show me the “App notification sends” per Target (rows) with three column: one displaying the first value (oldest) for dates selected and another one showing the most recent value during that specific time range. The third column displays % change. There would be only one slicer for the whole report. If I change the date in the slicer, the data change to get the oldest and most recent data for that specific time frame. The information displayed on other tables would also change.

 

Here is an example of what I would like to have for the whole month of march:

 

Date range: March

  
 

App notification sends

 App notification sends

Target

First sent

Last sent

% change

Area 1

100 000

16 515

-83%

Area 2

99 000

321 684

225%

 

 

I searched and found many ways to achieve this but only partly. Some way would not work with the slicer at all and display only the very first and last data from the whole table, other would apply the most recent/oldest filter to other table of the report… What would be the best way to do it?

1 ACCEPTED SOLUTION

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])))

 

 

View solution in original post

9 REPLIES 9
ChandeepChhabra
Impactful Individual
Impactful Individual

@PatP As of now my solution sums up all the values on the last date and first date

 

Here is the snapshot of the result. It is summing up both the values for area 2 for march

 

Capture2.PNG

 

You can download the pbix file here

@ChandeepChhabra Thank you for your help! It looks like what I'm looking for except for one thing : I would not sum the data, I would only display the last number. In my database I can get the date and time to make sure it's the very last push sent. How should we adjust your measure to show the first/last value only and not calculate the sum?

 

Thank you!

@PatP Hi, adding time is a good idea

After you refresh the pbi file, It will automatically ensure that the largest date (considering time) is picked up and measure will update automatically.

 

I just added random times to the dates, here is the result

 

Capture-a.PNG

 

Hope it helps

@ChandeepChhabra Thanks! This look like exactly what I'm looking for. The only thing I'm worried about, is if there is two notifications sent at exactly the same time, is there any way to take just the last entry? I would like to make sure I will never display a sum of different numbers.

 

Thank you again, I really appreciate it!

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])))

 

 

Thank you, this is exactly what I was looking for! 

 

Thanks for your help!

You are welcome!

ChandeepChhabra
Impactful Individual
Impactful Individual

@PatP Quick question.. In the month of march for Area 2, you have 2 sends on the last day (31 Mar). Is there any logic of picking up 321644 and not 51616 ?

 

For privacy reasons, the actual data has been changed. The idea is to be able to estimate the actual number that have the push enabled by seeing the variation during the month.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.