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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Multiple Conditions from Different Tables

Hello guys, 

 

I need to create a measure/column that is pulling items from three different tables: I need to calculate applications ID (from table 1) when the program is Computer (from table 2) or when activity is either 1,2, or 3 (from table 3). 

 

 I currently have this: 

 

Dax=calculate(distinct(count(application_ID), Program="1" || (activity=1 || activity=2 || activity=3))

 

But because I am creating a measure, I can't pull columns from other tables, as they are not coming when I type the column names. 

Please help.

Thanks, 

Sona

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @Anonymous,

Did any update for these? If you want to calculate based on multiple table fields, it should be better to share the table structure and relationship mapping.

For example: these tables are linked based on application_ID fields.

measure =
VAR t2List =
    CALCULATETABLE (
        VALUES ( Table2[application_ID] ),
        FILTER ( ALLSELECTED ( Table2 ), Table2[activity] IN { 1, 2 } )
    )
VAR t3List =
    CALCULATETABLE (
        VALUES ( Table3[application_ID] ),
        FILTER ( ALLSELECTED ( Table3 ), Table3[activity] = 3 )
    )
RETURN
    CALCULATE (
        COUNTROWS ( VALUES ( Table1[application_ID] ) ),
        FILTER (
            ALLSELECTED ( Table1 ),
            Table1[Program] = "1"
                || Table1[application_ID] IN UNION ( t2List, t3List )
        )
    )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

HI @Anonymous,

Can you please explain more detailed information to help us clarify your data structure and requirement? (e.g. data source type, relationship mapping...)

How to Get Your Question Answered Quickly

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

It will depend up on the layout of your tables and the relationships.  To get more help, share the link from where i can download your PBI file and show the expected result clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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