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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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