Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Guys,
I want to make conditional formatting based on column number (3) for the below table using DAX:
the values of column num (2) will appear in red if they exceed the values in front of it in column num (3), and they will be displayed in green if they do not exceed.
And please How can I apply this Dax to the table?
Thanks a lot
Solved! Go to Solution.
PFA , PBIX with table
Proud to be a Super User! |
|
It's a visualization table, not an data or regular table and I used the below measure to build it
@mhablas426 , First create a measure as per columns in your table
ColorMeasure =
IF(
[Fuel Current Month Q] > [SomeOtherMeasure], -- Replace [SomeOtherMeasure] with the actual measure or column you want to compare against
"Red",
"Green"
)
Then
1.Go to the Report view.
2.Add a table visual to the report and include the columns you want to display.
3.Select the table visual.
4.Go to the Format pane (paint roller icon).
5.Expand the Conditional formatting section.
6.Click on the drop-down arrow next to the column you want to format (e.g., Fuel Current Month Q) and select Background color or Font color.
7.In the Conditional formatting window:
Set the Format by option to Field value.
8.Set the Based on field option to the measure you created (ColorMeasure).
Click OK to apply the conditional formatting.
Proud to be a Super User! |
|
Thanks for your reply and your time, but I want first to convert this visualization table to a data table, a regular table!! How can I do that?
thank you again
@mhablas426 , Are you taking columns from different sources in this visualization?
Proud to be a Super User! |
|
yes, kindly see the snapshot
There are two ways you can do that first go to power query and use merge queries as new option and combined table 1 and 2 first on the basis of column on which relation is created then do it similarly for 3 rd table or use DAX to create new column
CombinedTable =
SELECTCOLUMNS(
NATURALINNERJOIN(
NATURALINNERJOIN(Table1, Table2),
Table3
),
"Column1", Table1[Column1],
Only if they share common key
"Column2", Table2[Column2],
"Column3", Table3[Column3]
)
Proud to be a Super User! |
|
How can i share with you the PBIX file here?
You could upload the file to OneDrive / Google Drive / DropBox and share the link here.
Proud to be a Super User! |
|
Many thanks to you. I appreciate your help 🙏
@mhablas426 , You can create a simple DAX for this
Column2Color =
IF(
SELECTEDVALUE('YourTable'[Column2]) > SELECTEDVALUE('YourTable'[Column3]),
"Red",
"Green"
)
Select the Table Visual: Click on the table visual where you want to apply the conditional formatting.
Open Conditional Formatting Options:
Go to the Format pane.
Expand the Conditional formatting section.
Click on the fx button next to the Font color option for the column you want to format (Column 2 in this case).
Set Up Conditional Formatting:
In the Conditional formatting window, select Field value under the Format by dropdown.
In the Based on field dropdown, select the measure you created (Column2Color).
Apply the Formatting: Click OK to apply the conditional formatting.
Proud to be a Super User! |
|
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
50 | |
38 | |
38 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |