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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Tamas_Praviczki
Frequent Visitor

Calculated column

Hi everybody! I imported data into Power BI as Folder. I have a column which contains text values and one of column contains decimal numbers. I would like to add a new calculated column in specific way: If the text column equals for example "XY", I want to make a calculation with the second column, and then everything else would be the same value from the second column (with decimal numbers) so I don't need to calculate where there isn't "XY" value in the first column. I don't know the syntax.

Thanks for every good idea. 

1 ACCEPTED SOLUTION
Mrxiang
Helper II
Helper II

It sounds like you want to use a calculated column in Power BI to first check if a specific text value exists in the first column, and if it does, use the second column to perform some calculation and return a new value.
To do this, you can use the "CASE" statement in DAX to check if the text value exists in the first column, and then use the "RETURN" statement to return a calculated value using the second column.
Here is an example of how you could set this up in your report:

1.Create a new calculated column in your report called "Special Value".
2.In the formula bar, enter the following expression:

CASE(Table1[Text Column], Table2[Column 2])

This will check if the text value exists in the first column, and if it does, will return the value from the second column, using the syntax of the "CASE" statement.
Note that this assumes that your "Table1" table contains the text values and your "Table2" table contains the values from the second column that you want to use for the calculation.
I hope this helps! Let me know if you have any questions or need further assistance.

View solution in original post

1 REPLY 1
Mrxiang
Helper II
Helper II

It sounds like you want to use a calculated column in Power BI to first check if a specific text value exists in the first column, and if it does, use the second column to perform some calculation and return a new value.
To do this, you can use the "CASE" statement in DAX to check if the text value exists in the first column, and then use the "RETURN" statement to return a calculated value using the second column.
Here is an example of how you could set this up in your report:

1.Create a new calculated column in your report called "Special Value".
2.In the formula bar, enter the following expression:

CASE(Table1[Text Column], Table2[Column 2])

This will check if the text value exists in the first column, and if it does, will return the value from the second column, using the syntax of the "CASE" statement.
Note that this assumes that your "Table1" table contains the text values and your "Table2" table contains the values from the second column that you want to use for the calculation.
I hope this helps! Let me know if you have any questions or need further assistance.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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