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
VarcharBI
Frequent Visitor

Tabular Editor Scripting - "Do Not Summarize"

Hi All,

Trying to create a Custom Script under Advanced Scripting in the Tabular Editor to Set Column Summarization to "Do Not Summarise" for all selected columns.
The code I have is as follows:

 

foreach(var c in Selected.Columns)
{
    c.SummarizeBy = "none";
}

 

However I am getting a data type error msg as follows:
CS0029 - cannot implicitly convert type "string" to TabularEditor.TOMWrapper.AggregateFunction

Any assistance to get this working will be much appreciated 🙂

1 ACCEPTED SOLUTION
VarcharBI
Frequent Visitor

Many many thanks to @dotykier - the owner and originator of the Tabular Editor... 😀

foreach(var c in Selected.Columns)
{
    c.SummarizeBy = AggregateFunction.None;
}

 

View solution in original post

3 REPLIES 3
VarcharBI
Frequent Visitor

Many many thanks to @dotykier - the owner and originator of the Tabular Editor... 😀

foreach(var c in Selected.Columns)
{
    c.SummarizeBy = AggregateFunction.None;
}

 

V-lianl-msft
Community Support
Community Support

Hi @VarcharBI ,

 


Implicit column aggregations in Power BI are not supported for models with calculation groups. Currently, if DiscourageImplicitMeasures property is set to false (default), aggregation options appear, however they cannot be applied. If DiscourageImplicitMeasures is set to true, aggregation options do not appear.




https://docs.microsoft.com/en-us/analysis-services/tabular-models/calculation-groups?view=asallprodu... 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


Hi Liang - and thanks for responding...

That said I don't understand why or whether this answers the question... in so far as... all I am trying to do is to bypass a manual process in the Desktop of setting a Column attribute from Sum to Do Not Summarize using an Advanced Script in the Tabular Editor... and I get the same error whether I am connected to a model with or without Calculation Groups.

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.

Top Kudoed Authors