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.
I'm trying to set conditional formatting for a measure. It needs to be based on two fields, one being a dimension attribute and one being a calculated measure on the fact table (that the measure is being created on). I thought I could do it with an if or switch statement, but it doesn't seem to like when I use an attribute on the dimension table.
Ex: =if(Region="North" & MarginPct>=.155, 1, (if(Region="North" & MarginPct<.155,0, (if(Region="South" & MarginPct>=.101,1,0)))))
Any ideas on how to solve?
Hi @Anonymous
You might consider providing your dummy pbix that would be helpful for us to investigate it further.
You can upload it to the onedrive for business and share the link here. please don't forget to disclose the expected results and remove the confidential info.
@Anonymous , You have to create a color measure like given example And use that in conditional formatting with "field value" option
color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)
calculate( [NumberofID],DATESMTD('Date dimension Table'[Date]), USERELATIONSHIP (Table2[CreateDate])
calculate(Max(Target[ratio])) *CALCULATE(
[Sales_Value],
SAMEPERIODLASTYEAR(
Date_DB[Date]))
refer
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
@Anonymous Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
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 |
---|---|
97 | |
97 | |
82 | |
75 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |