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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
AlexanderNN
Frequent Visitor

Change measure default behavior with calculation groups

Hey guys,

I just got a request to change the default behavior of all our measures in Power Bi and was wondering if any of you have any good tips before I start breaking everything 😅 

We have a central semantic model for our Sales data. What I want to to is alter the dafult calculations for a lot of measures. This is a a very simple measure which calculates our Order Inflow:

CALCULATE(
    SUM( 'Fact Order'[OrderinflowAmount] ),
    'Fact Order'[IsCancelled] = 0
)

We've recently acquired some companies and have mapped their historical sales to our channels (which is different websites) and I did this Calculation Group to alter the behavior of measures.

OnlyGroupSales: = CALCULATE(
    SELECTEDMEASURE( ),
    'Dim Order Source'[Channel] <> "OLD"
)

AllSales :  CALCULATE(
    SELECTEDMEASURE( )
)

The request is now to have the "OnlyGroupSales" as the default calculations for our measures. There are roughly 50 measures that I want to change the default behaviorof. I also want to have the ability to switch between the "AllSales" behavior and "OnlyGroupSales" behavior. 

Is this possible using calculation groups or do I have to change all individual measures and create a new calculation group that does the inverse of my OnlyGroupSales? I thought this would be an easy fix, but perhaps it is not possible. Any suggestions would be greatly appreciated 🙂 

1 ACCEPTED SOLUTION
mark_endicott
Super User
Super User

There's nothing I'm aware of that would do this. I think the solution is to change the reports. 

View solution in original post

4 REPLIES 4
datadatadatadat
Microsoft Employee
Microsoft Employee

Calculation groups have recently been extended to support default selections. Take a look at the 'noSelectionExpression' here Calculation groups in Analysis Services tabular models | Microsoft Learn
Simply paste the expression for 'OnlyGroupSales' into the noSelectionExpression, and it should apply to every measure reference without end users making any calc item selections. 

Note that you have to use tabular editor to author these artifacts.

mark_endicott
Super User
Super User

There's nothing I'm aware of that would do this. I think the solution is to change the reports. 

mark_endicott
Super User
Super User

If "OnlyGroupSales" and "AllSales" are calculation items within the same Calculation Group, then you can use a slicer or the filter pane to select "OnlyGroupSales" as the default, by having this selected when you share/publish the report, and users will be able to switch to the AllSales by using the filter. 

 

Sorry if I'm missing something and oversimplifying.  

Based on the description you aren't missing something. However, this model has around 10 reports tied to it and I am curious if it is possible to change the default behavior in the model instead of having to edit all reports. 

So your solution is the fallback solution if there's no other way.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!