cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stevenls
Helper III
Helper III

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
stevenls
Helper III
Helper III

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
stevenls
Helper III
Helper III

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

@stevenls , Kudos to you. Thanks for sharing.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
amitchandak
Super User
Super User

@stevenls , 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]))
)
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.