Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Guruprasad7
Regular Visitor

Apply color Palette to First Level items based on the Second level calculation.

Hi All,

Here is the screnario:
I want to apply color Palette to below First Level items based on the sublevel calculation.
First Level:

 


Under BCO - Second Level / Sub Level items:

 

Query : Want to Apply color on First Level, based on Second level Least % item.

For Example: First Level item BCO, it is holding the 10 items at Sub Level (after drill thru) & Minimum among the 10 item is 77.84%.

Requirement : Now on the First Level BCO should be also RED as one of the sub level item is RED.  
Logic :  If value is less than 80% then RED.. and few other condition for other colors.

Please help me out here with DAX funciton where we can apply colors.

Thank you in Advance.

Regards,
Guru


7 REPLIES 7
Guruprasad7
Regular Visitor

@lbendlin Posted sample data.

I need a DAX to apply below logic:
For BCO, it should be red -> as at the sub level one of the entity is red(Screenshot FYR)

 

 

lbendlin_0-1638837153261.png

see attached.

@lbendlin  Thanks For your time and help!
But my scenario is little different here , Avg Unit Value is measure containing Cumulative of last 6 month - which we cannot pass as Parameter to MIN(). 

So, I have attached PBI File link below, Please let me know if you can help me with cumulative avg.

Thank you in advance.
Regards,
Guru

This formula

Avg Unit Value = 
var selected_date = DATE(YEAR(SELECTEDVALUE('DIM CAL'[Date])),MONTH(SELECTEDVALUE('DIM CAL'[Date])),1)
var Last6 = DATE(YEAR(selected_date),MONTH(selected_date)-5,1)
VAR Cal  = CALCULATE( [AVERAGE UNIT VALUE],FILTER(ALL('DIM CAL'),'DIM CAL'[Date]<=selected_date && 'DIM CAL'[Date]>Last6))
return Cal

is incorrect.  You should use DATEADD or EDATE  to identify the last six months.

 

Anyway, I don't understand why you cannot pass the cumulative to the minx calculation. Please explain.

@lbendlin YES Dateadd () can be used but i'm getting correct values using current DAX.
and Cumulative I'm passing it to Minx but it not providing desired results:

Least = MINXALLEXCEPT ('FACT DATA''FACT DATA'[Plant] ),' DIM CAL' [Avg Unit Value])
Could you Please make changes here to the DAX Formula & make it happen to provided PBI File.
Then you can paste working formula here.

Thanks
Guruprasad7
Regular Visitor

PlantTech IDAvg Unit Value
BCOBCO-30-1000 UCWT92.86%
BCOBCO-BFW (EOE)95.83%
BCOBCO-BFW (UTE)100.00%
BCOBCO-BOILER100.00%
BCOBCO-CHILLED WATER76.56%
BCOBCO-CONDENSATE90.63%
BCOBCO-HOT WATER100.00%
BCOBCO-RX BOILER A100.00%
BCOBCO-RX BOILER B100.00%
BGOBEO U 1200 CT89.04%
BGOBEO U 121 CT90.83%
BGOBEO U 122 CT90.38%
BGOBEO U 124 CT93.44%
BGOBEO U PE CT91.75%
BGOBEO U PLP CT79.34%
BGOBEO U PP CT85.84%
BGOBEO-UCA-B-F110198.15%
BGOBEO-UCA-B-F1101-SAT100.00%
BGOBEO-UCA-B-F1101-SUP100.00%
BGOBEO-UCA-B-F1102100.00%
BGOBEO-UCA-B-F1102-SAT100.00%
BGOBEO-UCA-B-F1102-SUP100.00%
BGOBEO-UCA-BFW100.00%
BGOBEO-UCA-COND-POLSD100.00%
BGOBEO-UCA-COND-RET-BAD91.67%
BGOBEO-UCA-COND-RET-OKE94.44%
BGOBEO-UCA-DEMIN1100.00%
BGOBEO-UCA-DEMIN2100.00%
BGOBEO-UCA-DEMIN-OUT100.00%
BGOBEO-UCB-BFW-V140-3098.53%
BGOBEO-UCB-BFW-V140-3198.61%
BGOBEO-UCB-BOILER-F143100.00%
BGOBEO-UCB-COND-U111100.00%
BGOBEO-UCB-DEMIN-U13194.44%
BLOBLO-R - 1001C100.00%
BLOBLO-U1801 BP1 CWT96.30%
BLOBLO-U1802 BP2 CWT100.00%
BLOBLO-U1803 BP3 CWT98.15%
BYOBYO C CHILLER90.48%
BYOBYO CATALLOY CHILLER100.00%
BYOBYO CATALLOY JACKET92.31%
BYOBYO C-LINE JACKET92.86%
BYOBYO D CHILLER94.44%
BYOBYO D-LINE JACKET88.89%
BYOBYO E CHILLER NH3100.00%
BYOBYO E CHILLER PROPYL95.24%
BYOBYO E-LINE JACKET95.24%
BYOBYO-OLD CLX CWT95.65%
BYOBYO-OLD DLX CWT100.00%
BYOBYO-OLD ELX CWT100.00%
BYOBYO-OLD MARLEY CWT100.00%
BYOBYO-OLD MP3 CWT100.00%
BYOBYO-OLD MPX CWT100.00%
BYOBYO-OLD XL CWT100.00%
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.