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.
Hello,
In my PBI project, I have a report with a standard table.
I need to compare the values in 2 columns and change the background color of the specific cell based on values.
Two columns are named "Plan_Hours" and "Actual_Hours".
If Plan_Hours > Actual_Hours Then
Set Plan_Hours.BackgroundColor = GREEN
End
If Plan_Hours < Actual_Hours Then
Set Actual_Hours.BackgroundColor = RED
End
Is this something I need to do using DAX or is there another way.
Thanks in advance,
Rich
Solved! Go to Solution.
@Anonymous Yes, DAX and use Conditional Formatting with Rules. Something like:
Measure = IF(MAX([Plan_Hours])<MAX([Actual_Hours]),1,0)
Hi @Anonymous
Create two measures for 'Table'[Actual_Hours] and 'Table'[Actual_Hours] separately .
Plan hours = IF(SELECTEDVALUE('Table'[Plan_Hours])>SELECTEDVALUE('Table'[Actual_Hours]),"Green")
Actual hours = IF(SELECTEDVALUE('Table'[Plan_Hours])<SELECTEDVALUE('Table'[Actual_Hours]),"Red")
Then in Visual Fields , set conditional formatting for the two fields .
The final result is as shown :
I have attached my pbix file ,you can refer to it .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Create two measures for 'Table'[Actual_Hours] and 'Table'[Actual_Hours] separately .
Plan hours = IF(SELECTEDVALUE('Table'[Plan_Hours])>SELECTEDVALUE('Table'[Actual_Hours]),"Green")
Actual hours = IF(SELECTEDVALUE('Table'[Plan_Hours])<SELECTEDVALUE('Table'[Actual_Hours]),"Red")
Then in Visual Fields , set conditional formatting for the two fields .
The final result is as shown :
I have attached my pbix file ,you can refer to it .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous Yes, DAX and use Conditional Formatting with Rules. Something like:
Measure = IF(MAX([Plan_Hours])<MAX([Actual_Hours]),1,0)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
81 | |
67 | |
61 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |