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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Txtcher
Helper V
Helper V

DAX measure for Table Visual that Returns True/False Based on Related table related to 3rd table.

I need a measure that returns a true or false in a table visual.

Fact Table:  HCR Intakes

Related Fact Table:  Allegations

Dimension Table:  ANE 

Txtcher_1-1755716819501.png

 

I am trying to build a table visual containing columns from HCR Intakes. HCR Intakes[IntakeID] has a one to many relationship with Allegations[IntakeID]. In the table visual, I want to add a column that returns a True/False if the HCR Intake has an ANE Allegation: Allegation[Allegation]=ANE[ANE Allegation].

1 ACCEPTED SOLUTION
Shahid12523
Impactful Individual
Impactful Individual

Has ANE Allegation =
IF(
CALCULATE(
COUNTROWS(
FILTER(
'Allegations',
'Allegations'[IntakeID] = SELECTEDVALUE('HCR Intakes'[IntakeID]) &&
'Allegations'[Allegation] IN VALUES('ANE'[ANE Allegation])
)
)
) > 0,
TRUE(),
FALSE()
)

Shahed Shaikh

View solution in original post

6 REPLIES 6
v-hashadapu
Community Support
Community Support

Hi @Txtcher , hope you are doing great. May we know if your issue is solved or if you are still experiencing difficulties. Please share the details as it will help the community, especially others with similar issues.

Shahid12523
Impactful Individual
Impactful Individual

Has ANE Allegation =
IF(
CALCULATE(
COUNTROWS(
FILTER(
'Allegations',
'Allegations'[IntakeID] = SELECTEDVALUE('HCR Intakes'[IntakeID]) &&
'Allegations'[Allegation] IN VALUES('ANE'[ANE Allegation])
)
)
) > 0,
TRUE(),
FALSE()
)

Shahed Shaikh
johnt75
Super User
Super User

You could try a measure like

Has ANE Allegation =
IF ( NOT ISEMPTY ( CALCULATETABLE ( ANE, Allegations ) ), "Yes", "No" )

This works by using the Allegations table as a filter - the expanded Allegations table will include all columns from the ANE table, and the Allegations table is itself filtered by the Intake ID in your table visual.

Sahir_Maharaj
Super User
Super User

Hello @Txtcher,

 

Can you please try this approach:

 

Has ANE Allegation :=
VAR CurrentIntake = MAX ( 'HCR Intakes'[IntakeID] )
RETURN
IF (
    CALCULATE (
        COUNTROWS ( 'Allegations' ),
        KEEPFILTERS ( 'Allegations'[IntakeID] = CurrentIntake ),
        TREATAS ( VALUES ( 'ANE'[ANE Allegation] ), 'Allegations'[Allegation] )
    ) > 0,
    TRUE(),
    FALSE()
)

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

@Sahir_Maharaj 
Thank you for your response. I tried the measure, but unfortunately when I add it to the visual, I eventually receive an error stating the query has exceeded the available resources.

Txtcher
Helper V
Helper V

I think I figured it out. It took a few steps and I do not know if it is correct, but it worked:

1. Added a calculated column to the Allegations table:

Is ANE = 
    IF(
        RELATED('ANE'[ANE Allegation]) = Allegations[Allegation], 
        "Yes",
        "No"
    )

2. Added a calculated column to the HCR Intakes table:

ANE = 
If(
    COUNTROWS(
        FILTER(RELATEDTABLE(Allegations),Allegations[Is ANE] = "Yes"))
        > 0,
        "Yes",
        "No"
    )  

If anyone has a better more efficient solution, please share. Otherwise, my method appears to be working.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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