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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Coming up with a sum from two different tables

Hi there,

In experience has ground me to a halt here.

I have to come up with a sum from two widgets that I have on a report, one is a measure and the other is just the result of filtering.  I didn't know this was going to be part of the ask until I was showing my manager where I am at and I got the "Can you show the subtraction of that from that".

Here is my issue.

RackMounted_01.JPG
What I need to get to using this as an example is another box that shows 26, the shortfall for the max number of crew compared to the amount of rack mounted machines we have at the moment.

The Rack Mounted count is a number that is built on filtering data from the CMDB table.  Basically just filtering for certain hardware types and show a count of the Rack Mounted machines, there are page wide filters but the basis of that widget is there.

 

The other number, the maximum is from a measure I made.

Forecast Maximum Crew Count = 
MAXX(
	KEEPFILTERS(VALUES('AnimalForecasts'[Date])),
	CALCULATE(SUM('AnimalForecasts'[Count]))
)
 
The AnimalForecasts table is just our crew counts per month.  The info for the rack mounted counts comes from the 'ComputerConfigCMDB' table.
 
Is there a way for me to construct a sum that will subtract the Rack Mounted number from the Max Crew number to come up with a "Total Needed Per Craft" count?
 
Thank you kindly, I am in a bit of a mess with this one.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Astoundingly I actually worked this out.  I created a quick measure using the GUI box and built up the filters in the measure.. once I figured out you can't use Where in DAX I ended up with two measures and created a third measure which was a subtraction of measure 1 from measure 2.

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Astoundingly I actually worked this out.  I created a quick measure using the GUI box and built up the filters in the measure.. once I figured out you can't use Where in DAX I ended up with two measures and created a third measure which was a subtraction of measure 1 from measure 2.

 

 

@Anonymous , Kudos to you. Thanks for sharing.

amitchandak
Super User
Super User

@Anonymous , can you share data example?

 

Based on what I got so far

Forecast Maximum Crew Count = 
SUMX(
	KEEPFILTERS(VALUES('AnimalForecasts'[Date])),
	CALCULATE(SUM('AnimalForecasts'[Count]))
) - 
MAXX(
	KEEPFILTERS(VALUES('AnimalForecasts'[Date])),
	CALCULATE(SUM('AnimalForecasts'[Count]))
)

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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