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 !! YouTube Channel !! Connect on Linkedin

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 !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!