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
Cramos
Frequent Visitor

Sum Total vs a single value

Hi,

 

I'm stuck with something very silly but I'cant find the solution.

 

I have the sales for the month and a target for each month. 

 

Something like this:

 

Table 1

 

MONTHTarget
Ene1200
Feb1345
Mar789
Abr1500
May

1600

 

Table 2

 

 SalesTarget
January SHOP 11281200
January SHOP 22351200
January SHOP 35241200
January SHOP 45761200

 

 

What I need is to calculated the total sales of all the shops vs the target of the moth that is 1200.  Solution expected 1463-1200=263. Which will be the optimum method to do this?

 

 

 

Thanks!!

 

 

1 ACCEPTED SOLUTION
hohlick
Continued Contributor
Continued Contributor

Your tables have to be linked someway, for example, by month (Table1 to Table 2, 1 to many)

 

Then a new measure:

Sales diff = CALCULATE(SUM('Table 2'[Sales]))-CALCULATE(SUM('Table 1'[Target]))

 

Then you'll get desired amount for all months or for selected month only.

For example, if you make a bar chart visual with month number as x-axis, and put this measure in the values, you'll get what you want

Maxim Zelensky
excel-inside.pro

View solution in original post

4 REPLIES 4
hohlick
Continued Contributor
Continued Contributor

Are the months have different names in your tables? "Ene" and "January"?

Maxim Zelensky
excel-inside.pro

Always the same, in fact i'm using the number of the month

hohlick
Continued Contributor
Continued Contributor

Your tables have to be linked someway, for example, by month (Table1 to Table 2, 1 to many)

 

Then a new measure:

Sales diff = CALCULATE(SUM('Table 2'[Sales]))-CALCULATE(SUM('Table 1'[Target]))

 

Then you'll get desired amount for all months or for selected month only.

For example, if you make a bar chart visual with month number as x-axis, and put this measure in the values, you'll get what you want

Maxim Zelensky
excel-inside.pro

Works perfectly! Thank you so much!!

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.