Forum Discussion
ThimmaiahS
9 months agoNew Member
Dynamical conditional formatting for multiple columns
Hello Community, I have Is there any possible way to apply conditional formatting for multiple columns with dynamic dax. suppose if columns contains values like: A1, then fill the Green...
- 8 months ago
Hi ThimmaiahS ,
if you have 365 columns for 365 days then its advisable to unpivot the data in Power Query and then use it for filtering and conditional formatting.
if you still want to keep all columns intact then you can write switch statement for managing the conditional formatting.something like below.
Dynamic Background Color = VAR CurrentValue = SELECTEDVALUE( 'YourTable'[YourValueColumn] ) -- Note: If your values are aggregations (like count/sum), use that measure instead -- e.g., VAR CurrentValue = [Total Count] RETURN SWITCH( TRUE(), CurrentValue = "A1", "#00FF00", -- Green CurrentValue = "B1", "#0000FF", -- Blue CurrentValue = "I1", "#FFFF00", -- Yellow "#FFFFFF" -- Default White )Please give kudos or mark it as solution once confirmed.
Thanks and Regards,
Praful
123abc
9 months agoCommunity Champion
Following community solution can help you:
Conditional Formatting Using Custom Measure - Microsoft Fabric Community
Solved: Color coding with DAX - Microsoft Fabric Community
Power BI Conditional Formatting Based On Field Value
Using field parameters and calculation groups for conditional formatting - SQLBI