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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Iguinrj
Helper I
Helper I

Questions for Creating a Conditional Column

I would like some guidance on how to create a column that satisfies the following condition: I want the column to return me if the attribute value "A1" for element "E1" in table "A" is equal to or different from the attribute value "A1" for element "E1" in table "B". And so on... If the values ​​are equal, I would like the column to display the message "equal parameters"; otherwise "parameters different". It is important to mention that the attributes and elements are the same in all tables.image.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Iguinrj ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a calculated column.

Column = var a=CALCULATE(DISTINCTCOUNT('Table'[TABELA]),FILTER('Table','Table'[TABELA]<>EARLIER('Table'[TABELA])))
var b=CALCULATE(DISTINCTCOUNT('Table'[TABELA]),FILTER('Table',[EMEMENTO]=EARLIER('Table'[EMEMENTO])&&[ATRIBUTO]=EARLIER('Table'[ATRIBUTO])&&[TABELA]<>EARLIER('Table'[TABELA])))
return IF(a=b,"equal parameters","parameters different")

(3) Then the result is as follows.

vtangjiemsft_0-1689143832657.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

View solution in original post

3 REPLIES 3
Iguinrj
Helper I
Helper I

@Anonymous 

All is well?

I thought I had solved it, but I couldn't get the expected result. I'm sending you a model so you can apply the solution, please.

I need to compare versions of the same attribute of the same element from each table.

If they were the same, I wanted it to return me in the matrix line: "equal versions". If different, return in line: "parameters different".

This comparison needs to be between each attribute of each element of each table.

Iguinrj_0-1689184868754.png

 

I am not able to attach the pbix with

 

Iguinrj
Helper I
Helper I

Thank you friend. I have a great day
Anonymous
Not applicable

Hi @Iguinrj ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a calculated column.

Column = var a=CALCULATE(DISTINCTCOUNT('Table'[TABELA]),FILTER('Table','Table'[TABELA]<>EARLIER('Table'[TABELA])))
var b=CALCULATE(DISTINCTCOUNT('Table'[TABELA]),FILTER('Table',[EMEMENTO]=EARLIER('Table'[EMEMENTO])&&[ATRIBUTO]=EARLIER('Table'[ATRIBUTO])&&[TABELA]<>EARLIER('Table'[TABELA])))
return IF(a=b,"equal parameters","parameters different")

(3) Then the result is as follows.

vtangjiemsft_0-1689143832657.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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