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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ryanb11
Helper III
Helper III

Switch dax not working due to relationsip

Hi the below Switch dax not working due to a relationsip:

 

DimensionColumn = SWITCH(FIRSTNONBLANK('Dimension'[Dimension],1)
   ,"Customer Type", RELATED('Relationship'[Customer Type])
   ,"Organization Type", RELATED('Relationship'[Organization Type]))

ERROR: The column 'Relationship[Organization Type]' either doesn't exist or doesn't have a relationship to any table available in the current context.

 

I have the following relationships created:

 

Table: Relationship

Column: ID

=

Table: DimensionToRelationship

Column: ID

**Note the IDs are not unique in the tables, I tried creating indices for each table and create relationship but didnt help.

 

 AND:

 

Table: DimensionToRelationship

Column: DimensionColumn

=

Table: Dimension

Column: DimensionColumn

4 REPLIES 4
amitchandak
Super User
Super User

@ryanb11 , related will only work from 1-M direction.  Is this a column or measure.

Share relationship diagram

I have tried but I cannot copy and paste into the message, and I cannot convert the image to a URL

dax
Community Support
Community Support

Hi @ryanb11 , 

I can't repduce your design based on your description,  if possible could you please inform me more detailed information(such as your expected output and your sample data (OneDrive for Business))? Then I will try to test this in my environmnet.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

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

thanks for getting back to me, it is a new column

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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