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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Calculate value using IF condition across multiple tables

I have data across 3 tables.

 

First table has the mapping codes for the other 2 tables

AIMSCodeCHRISCodeHealthService
10008000Alfred Health
20009000Monash Health

 

Second table provides the data for the AIMS system that stores data for the the number of beds available

AIMSCodeTypeValue
1000beds available8
2000beds available10

 

Third table provides information on how many beds are currently used

CHRISCodeTypeValue
8000Occupied Beds15
9000Occupied Beds6

 

Basically what I'm trying to achive is [beds available]- [occupied beds] for each health service, and if the value is less than zero then ignore but add up the health services that are greater than zero.

 

So essentially I want the measure to return 4 in this instance (10-6). 

 

I have been wracking my brain trying to figure this out but have been completely unsuccessful. Thank you for any help!

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Anonymous 

 

Please download this file and let me know if it does not cover your request:

https://gofile.io/d/ebakXo

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos ✌️!!

View solution in original post

3 REPLIES 3
VahidDM
Super User
Super User

Hi @Anonymous 

 

Please download this file and let me know if it does not cover your request:

https://gofile.io/d/ebakXo

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos ✌️!!

Anonymous
Not applicable

awesome! this has given me the basic idea on how to do this!

wdx223_Daniel
Super User
Super User

assume you have create one to many replationship between those tables, and try this code

NewMeasure=MAX(BLANK(),MAXX(Table1,CALCULATE(SUM(Table2[Value])-SUM(Table3[Value]))))

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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