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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rahulvinod
Regular Visitor

need help with dax query that can be used as a function in a shape to change the color of shadow.

hi community,
i am new to power bi. i want help in the following

i created a new measure as following.

Make Transparent xz =
IF (
ISBLANK ( Query1[per t1 2 t] ) && ISBLANK ( Query1[pre t2 2 t] ) ,
"#FFFFFF00",
IF (
DIVIDE ( SUM ( Query1[DQ T1] ), SUM ( Query1[Total T1] ) ) >= .95
&& DIVIDE ( SUM ( Query1[DQ T2] ), SUM ( Query1[Total T2] ) ) >= .90,
"#59a14f",
"#e15759"
)
)

i wanted to use the same measure in a shape and change the shadow. but we dont have the option to use filters in shapes rights. so i want to use following measure with the following filters

date, sub name and db name values will come from slicers dynamically and default sub name and db name will be in select all option.

and other filter called master should be given as 'XZ' and this is constant. all the columns are in the same table.

when i use the new measure as a function in the shadow of the shape and select format type as field value, its shouldnt get summarization option.

Please help.

thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rahulvinod ,

 

You can create a list of parameters containing the following: Date, Sub Name, DB Name and Master. in the Master column, add a constant value 'XZ'.
Then modify the formula to apply the created metric to the conditional format. Refer to the following:

vkongfanfmsft_0-1705393061285.png

 

Make Transparent xz1 = 
IF (
   ISBLANK ( MAX(Query1[per t1 2 t]) ) && ISBLANK ( MAX(Query1[pre t2 2 t]) ) ,
   "#FFFFFF00",
   IF (
      DIVIDE ( SUM ( Query1[DQ T1] ), SUM ( Query1[Total T1] ) ) >= .95
      && DIVIDE ( SUM ( Query1[DQ T2] ), SUM ( Query1[Total T2] ) ) >= .90
      && VALUES(Parameter[Master]) = "XZ",
      "#59a14f",
      "#e15759"
   )
)

vkongfanfmsft_1-1705393155033.png

If there is a problem, please provide detailed test data and screenshots of the desired results.

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @rahulvinod ,

 

You can create a list of parameters containing the following: Date, Sub Name, DB Name and Master. in the Master column, add a constant value 'XZ'.
Then modify the formula to apply the created metric to the conditional format. Refer to the following:

vkongfanfmsft_0-1705393061285.png

 

Make Transparent xz1 = 
IF (
   ISBLANK ( MAX(Query1[per t1 2 t]) ) && ISBLANK ( MAX(Query1[pre t2 2 t]) ) ,
   "#FFFFFF00",
   IF (
      DIVIDE ( SUM ( Query1[DQ T1] ), SUM ( Query1[Total T1] ) ) >= .95
      && DIVIDE ( SUM ( Query1[DQ T2] ), SUM ( Query1[Total T2] ) ) >= .90
      && VALUES(Parameter[Master]) = "XZ",
      "#59a14f",
      "#e15759"
   )
)

vkongfanfmsft_1-1705393155033.png

If there is a problem, please provide detailed test data and screenshots of the desired results.

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors