Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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 lotTable
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 February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
83 | |
69 | |
68 | |
39 | |
37 |