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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

If statement returning results from separate table

Hi All,
I have two tables Faults_IEC and Faults_GADS both have a category column and unique IDS for each category. I'm trying to build a measure that can be used in a graph to show 

if IEC category = "Forced Outage*" then return Gads category if not return IEC category.

I initial thought to merge the two tables in Power Query however the Unique ID's overlap.

Ideally, I would want to be able to use it in a bar chart like below

Mburman07_0-1732633565810.png

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

You can create a calculated column as below in the table Faults_IEC, later check if it is working OK in your side.

Column =
IF (
    'Faults_IEC'[IEC category] = "Forced Outage*",
    CALCULATE (
        MAX ( 'Faults_GADS'[Gads category] ),
        FILTER ( 'Faults_GADS', 'Faults_GADS'[ID] = 'Faults_IEC'[ID] )
    ),
    'Faults_IEC'[IEC category]
)

 

If the above one can't help you figure out, please provide some raw data in the table Faults_IEC and Faults_GADS (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

MFelix
Super User
Super User

Hi @Anonymous ,

 

Create a dimension table with the Category then do the calculation based on that category table should give you the correct resutl so would be something similar to:

 

Calculation = IF( NewDimensionTable[IEC category] = "Forced Outage*" , [GADS Calculation], [IEC Calculation])

 

don't know if you are doing a sum or a count or whatever calculations so I added the [..calculation] for example purposes.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors