Forum Discussion
Conditional Format Based on Two Columns
- 2 years ago
Hi
You can create a flag measure with a combined condition with "and"
And base a conditional formatting on this measure.
For more detailed suggestionPlease provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - 2 years ago
As I mentioned it is a scenario to combine measure if you will attach data I will try to show how it can work 🙂
- 2 years ago
Hi kp_wood13
If i understood correctly you can use Dax measure like :Flag for formatting =if ((max('Table'[stage]) = "initiate" || max('Table'[stage]) = "Plan") && max('Table'[Value])= "N", "red",if (MAX('Table'[Value])= "Y", "green"))and use it in the conditional formatting of the matrix:Result:
you can use hex color codes instead of their names if you want other green/red
PBIX is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickl
- 2 years ago
For what it's worth I found a solution in this post. Rather than just looking at the two stages I'm making rules for all 4.
Ok basically in English I'm looking for:
IF 'Query1'[stage]="Initiate" || 'Query1'[stage]="Plan" && 'Query2'[impl_dates]="N" || 'Query2'[funding_dates]="N" || 'Query2'[cost_plan]="N" || 'Query2'[budget_plan]="N" THEN "BLANK" ELSE "GREEN"
- Ritaf19832 years ago
Super User
As I mentioned it is a scenario to combine measure if you will attach data I will try to show how it can work 🙂
- kp_wood132 years ago
Helper I
Here's a sample table based on my 'Query1' table. Background colors didn't copy in but basically any "N" in the first two rows should have no background color because [stage]=Initiate or Plan, but the bottom two rows they'd be Red. "Y" is green regardless of the stage listed.
stage prj_description impl_dates impact_entities funding_dates cost_plan budget_plan Initiate N Y N Y N Y Plan Y N Y N Y N Execute N Y N Y N Y Close Y N Y N Y N - Ritaf19832 years ago
Super User
Hi kp_wood13
If i understood correctly you can use Dax measure like :Flag for formatting =if ((max('Table'[stage]) = "initiate" || max('Table'[stage]) = "Plan") && max('Table'[Value])= "N", "red",if (MAX('Table'[Value])= "Y", "green"))and use it in the conditional formatting of the matrix:Result:
you can use hex color codes instead of their names if you want other green/red
PBIX is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickl