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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Migscruz
Helper I
Helper I

How to compare sales from different periods

Hi to all!

 

Is there a way to compare the sales in different periods? for example i want to compare sales from November 11th 2020 vs October 3th 2020. I can't add tables because i have live connection but i would like to know if theres a way to do that with dax and selecting the dates i want. I only have a sales table, products table and date table.

 

Thanks!

2 REPLIES 2
Anand24
Super User
Super User

Hi @Migscruz ,

 

@v-yiruan-msftis absolutely correct. You can't create new calculated column or new calculated table using DAX when using Live Connection. You will need to do that in the actual Source dataset.

However, since you can create new Calculated measure using DAX, you can simply create 2 new measures in the report for 11th November & 3rd October and then compare them.

New Sales Measure 1 = CALCULATE(Sum(Sales), [Date]=DATE(2020,11,11))

New Sales Measure 2 = CALCULATE(Sum(Sales), [Date]=DATE(2020,10,3))


You will have to change the DAX for comparing other dates.

Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!

v-yiruan-msft
Community Support
Community Support

Hi @Migscruz ,
Since your data source is with live connection mode, this means that you cannot create any calculated table. Only can create report-level measures. Two date tables must exist When you want to arbitrarily select two dates to compare sales of these two different dates. Then the another date table can only be added from your source model.
Best Regards

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.