Forum Discussion
DAX formula for Matrix visual
- 2 years ago
First, create a calculated measure that will evaluate if the demand exceeds the allocated capacity or not. Use the following logic in the DAX formula:
DemandVsCapacity =
IF(
SUM(SalesTable[Total Demand]) > SUM(SalesTable[Model Allocated Capacity]),
1,
0
)- eplace SalesTable with the name of your table, and Total Demand and Model Allocated Capacity with the corresponding column names.
Conditional Formatting in Matrix Visual:
After creating the DAX measure DemandVsCapacity, add it to your Matrix visual.
Go to the Values area of the Matrix visual, click the dropdown next to the new measure DemandVsCapacity, and select Conditional Formatting > Background Color.
In the conditional formatting settings, choose Field Value and select the measure DemandVsCapacity.
Define the colors for the output:
- For 0 (Demand less than Capacity): Choose Red.
- For 1 (Demand greater than Capacity): Choose Green.
Now, based on the comparison of demand and capacity, your Matrix visual will show cells with red or green backgrounds.
If you have still issue with this problem pleaes feel free and contact with me.
First, create a calculated measure that will evaluate if the demand exceeds the allocated capacity or not. Use the following logic in the DAX formula:
DemandVsCapacity =
IF(
SUM(SalesTable[Total Demand]) > SUM(SalesTable[Model Allocated Capacity]),
1,
0
)
- eplace SalesTable with the name of your table, and Total Demand and Model Allocated Capacity with the corresponding column names.
Conditional Formatting in Matrix Visual:
After creating the DAX measure DemandVsCapacity, add it to your Matrix visual.
Go to the Values area of the Matrix visual, click the dropdown next to the new measure DemandVsCapacity, and select Conditional Formatting > Background Color.
In the conditional formatting settings, choose Field Value and select the measure DemandVsCapacity.
Define the colors for the output:
- For 0 (Demand less than Capacity): Choose Red.
- For 1 (Demand greater than Capacity): Choose Green.
Now, based on the comparison of demand and capacity, your Matrix visual will show cells with red or green backgrounds.
If you have still issue with this problem pleaes feel free and contact with me.