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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
v-kongfanf-msft
Community Support
Community Support

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
v-kongfanf-msft
Community Support
Community Support

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.