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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
jalaomar
Helper IV
Helper IV

check if one column value equals another column value

Hi,

 

I would like to check if the Value Project Classification/Applicant is the same or not for the ID, tried with the follwoing DAX but doesn't work. What am I doing wrong?

 

jalaomar_0-1668087666885.png

 

5 REPLIES 5
Anonymous
Not applicable

@jalaomar -I have tried the same dax at my end and i got the resultes like this

BIHelper_0-1668507148839.png


i think you are creating the calculated column on the side of one in relationship.you need to createcalculated column on the side of many.

I tried creating calculated column on one side of relationship it gave me the same error.
If you find this as correct then please mark it as solution.
Thank You!

ToddChitt
Super User
Super User

The table from which you are creating this calculated DAX column needs to be on the MANY side of a one-to-many relationship with the table/column in the RELATED function, and it appears that is not the case. 

 

If I have three tables, City, State, and Country, then from the City table I can write a funtion like this:

MyCountry = RELATED('Country'[Country Name]) and DAX can navigate up the tables from City to State and from State to Country to know where you are.

Buy if I try it the other way around: from the Country table:

MyCity = RELATED('City'[City Name]) 

Then DAX can't figure that out because there are MANY Cities and MANY States in each ONE Country.

Or if there are NO relationships between the two.

 

Check your Model Design and make sure you have the right relationships defined.

 




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Hi,

 

I try to create One to Many relation but PBI automaticall changes to Many to One 

do you know what that is?

 

also is there a different way to manage this comparision between two columns?

 

BR

J

Your screen shots are very small. Can you copy and paste the formula as text, and also show us the relationship between the two tables?

 

Regarding switching from ONe-to-Many to Many-to-One:

Power BI will inspect the cardinality of the two columns when you drag and drop a join between them. Using my example above, if I drag from StateID of my State table to the StateID of the City table, Power BI will create a One-to-Many relatonship with State table shown at the top, and City table at the bottom. It mean: For every ONE State ID (in the top table), that value can show up MANY times in the City table (bottom). But if I drag the other way around (from City to State tables on State ID), my relationship will be Many-to-One (MANY State ID's in City table (top) can show up ONE time in State table (bottom) ). It's the same thing really.

It's like this: ONE Parent can have MANY children (one-to-many) or MANY children can have the same Parent (Many-to-one).




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Hi,

 

this is the formual, it's created in the ZCV_PROJ_PROFITABILITY table.

 

Column = IF(RELATED('Governance Dimesions'[Applicant Text])=ZCV_PROJ_PROFITABILITY[Applicant Text],1,0)
 
and this is the current relationship between the tables 
 
jalaomar_1-1668436420887.png

 


 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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