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
Anonymous
Not applicable

Highlight table by slicer

Hi I have a power BI matrix table where i am showing cost center wise forecast and actuals. Now i've created a slicer based on cost center list. Now i want when i select a cost center from that slicer it would highlight that cost center in that table instead of filtering it from the entire table.

The DAX formulae i used is below 

 

Highlight =
VAR selectedpu =ALLSELECTED(PU_Lookup[Prod Unit Code])
return
IF(ISCROSSFILTERED(PU_Lookup[Prod Unit Code]),if(max('Regular TB'[Actuals]) IN selectedpu, 0, 1), 1)
after that when i used that measure to in conditional formatting it  gives me following error
"Mdxscript(Model) (31,80) calculate error in measure (table_name[Highlight]: function 'CONTAINSROW' does not support comparing values of type of text with type of numbers. Consider using the VALUE or FORMAT function to convert one of the values."
 
any idea what is going wrong?
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

You have a field type mismatch between [Prod Unit Code]  and [Actuals].  Please correct that.

View solution in original post

2 REPLIES 2
v-xulin-mstf
Community Support
Community Support

Hi @Anonymous

 

Is your issue solved? If the issue has been solved, please adopt the solution to help others.

The measure works well in my encironment, please change the data type according to the error message and check.

vxulinmstf_0-1627441049432.png

vxulinmstf_1-1627441169917.pngvxulinmstf_2-1627441179448.png

 

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

lbendlin
Super User
Super User

You have a field type mismatch between [Prod Unit Code]  and [Actuals].  Please correct that.

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.