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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
smpa01
Community Champion
Community Champion

Automating bulk inclusion of conditional Formatting and exlusion items in CG

@AlexisOlson @parry2k @BernatAgulloMVP 

 

When I create a calculation group, forEach calcculation item in the CG, I need to manually account for conditionalFormatting items (e.g. conditionalFormatting ) as well as any exclusion items (e.g. exclusion for CrossFiltering ) by adding them in each calculatio item in CG. Is there a way to automate that, forEach of m calculation items {  n conditional formatting , q exclusion item }.

 

 

smpa01_0-1715191004894.png

 

 

 

 

 

Thank you in advance.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
3 REPLIES 3
BernatAgulloMVP
Most Valuable Professional
Most Valuable Professional

C# scripts can automate anything you can do manually, so the answer is yes. You might find this session of mine relevant.

 

https://youtu.be/UWM1RIpAMtk?si=kYyl-X8-nocOs01s

 

Check also this article of my blog

C# Scripting nirvana: effortlessly use Visual Studio as your coding environment for Tabular Editor C# Scripts | Esbrina https://www.esbrina-ba.com/c-scripting-nirvana-effortlessly-use-visual-studio-as-your-coding-environ...

BernatAgulloMVP
Most Valuable Professional
Most Valuable Professional

Not with DAX. But you can automate the creation of calculation groups with a c# script. For many Calc items i rather keep a Calc table with the names of the measures to include. But default the rest are excluded by the transformation

@BernatAgulloMVP  sorry for late reply. Is it not possible at all for c# to create each calulation items in a specific way like below?

 

calCItemOne =
var one = [measure]
var two = conditionalFormt
var three = exclusionTable

return three

 

The issue that I am facing, that whenver I create a new calculation item in a CG, I need to manually create this. Is there no way to automate this? Would be great if possible.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.