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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

compare value based on 2 date selected

HI all, I'm new to PowerBI and figuring out the way to visulize result of 2 date comparison. 

 

Raw data I have:

PageDatePageView
A2019 Mar 215
A2019 Mar 420
A2019 Mar 105
B2019 Mar 28
B2019 Mar 316
B2019 Mar 420
C2019 Mar 5100

 

Expected output:

[Filter, only select 2 date per report, e.g. i select Mar-2 & Mar 4]

Page2019 Mar 22019 Mar 4Difference
A15205
B82012
C000

 

*OK not showing C if there's no value on that date.


Thanks in advance!

 

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

Kindly check my below results:

000.PNG

Pbix attached.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

4 REPLIES 4
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

Kindly check my below results:

000.PNG

Pbix attached.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

The Table 2 = CALENDAR(DATE(2019,1,1),DATE(2019,12,31)) did the trick!!!
Amazing! thanks a lot!!
amitchandak
Super User
Super User

@Anonymous 

Prefer a diff measure like given below. Prefer 1st if it works


Measure =
var _max = maxx(Date,date[Date])
var _min = maxx(Date,date[Date])
return
calculate(sum(Table[PageView]),date[Date]=_max) - calculate(sum(Table[PageView]),date[Date]=_min)


Measure =
var _max = maxx(Date,date[Date])
var _min = maxx(Date,date[Date])
return
calculate(sum(Table[PageView]),filter(all(Date),date[Date]=_max)) - calculate(sum(Table[PageView]),filter(all(Date),date[Date]=_min))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

'All' is my table, the diff is always 0.
 
DateDifference =
var _max = MAXX('All', 'All'[Date])
var _min = MINX('All', 'All'[Date])
return
calculate(sum('All'[pageview]),filter(ALL('All'[Date]),'All'[Date]=_max)) - calculate(sum('All'[pageview]),filter(ALL('All'[Date]),'All'[Date]=_min))

 
Capture.PNG

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors