The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
Solved! Go to Solution.
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.
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.
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |