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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Compare values for two dates

Hello!

 

I have a single table with salesnumbers per customer per date:

 

ID|Date |Sales
1 |1.May|$100
2 |1.May|$120
3 |1.May|$0
1 |2.May|$110
2 |2.May|$90
3 |2.May|$20
1 |3.May|$80
.
..
...

 

Now, whats probably somehow special, is that those salesnumbers are not the value for a given single day but rather the total sum for the customer (i.e: customer number 1 had a total of $100 as per 1.May; but per 3. May his salesnumber decreased to a total sum of $80 - this customer canceled some orders). 

 

What I need to do in Power BI: the user needs to be able to select two dates in the report and a table needs to show the difference between those to dates.

 

So if the user chooses to compare the 1.May to the 2.May the result needs to show for customer 1:

Actual value: $110

Difference: +$10

 

Any help how to make this possible if very much appreciated!

1 ACCEPTED SOLUTION
popov
Resolver III
Resolver III

Hi, @Anonymous

I prepared sample Power BI file. Hope it help you.

https://1drv.ms/u/s!AjofTPMqM9m3lpFSfZzIP3BhUFEL4w

View solution in original post

3 REPLIES 3
popov
Resolver III
Resolver III

Hi, @Anonymous

I prepared sample Power BI file. Hope it help you.

https://1drv.ms/u/s!AjofTPMqM9m3lpFSfZzIP3BhUFEL4w

Anonymous
Not applicable

Thanks so much! I‘ve been struggling a bit with adapting your solution to my model (which is a bit more complex then described) but I think its working now! (just a little sidenote if anyone else will be using this solution: I changed the formula for the measure Difference

Difference = [Actual value]- CALCULATE( SUM( Sales[SalesAmount] ); USERELATIONSHIP(Sales[Date]; 'Compare Calendar'[Date]); ALL('Calendar') )

Because what I wanted to know was the diff-value to the "Actual value". 
Thanks again!

Anonymous
Not applicable

Hi, I am facing a similar problem which includes the user to select 2 different dates on the slicers and the comparison should give a resut of increase or decrease of the sales between the selected dates. I tried to use the solution provided here, but I am unable to check the file. Could you help me resolve my issue. Thanks

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.