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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
smpa01
Super User
Super User

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
New Member

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
New Member

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.