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
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
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.