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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
DKfromtheBay
Frequent Visitor

Weird Calculation Group Behavior

EDIT: It appears that the best practice for calculation items is to only apply them to expressions containing single measures.  The article from SQLBI that explains this is a bit confusing to me so if anyone feels like helping to explain how the expression evaluates it would be appreciated.

Understanding the Application of Calculation Items - SQLBI

 

Hi all

I'm an experienced PBI user and hoping to get some help on a bizarre issue I'm seeing.

I have a calculation group for time intelligence calculations, and I'm adopting the DAX patterns from SQLBI as my use case requires some filtering that prevents the native time intelligence functions from working (i.e. excluding non working days etc.).

I have a proper data model w/ Date dimension and the calculations all work fine, except for this scenario which I can't figure out.

You can see the normal standard measures broken out by year, with the Average Cost per Project being a simple DIVIDE() function using the Project Costs and Project Count measures that you see above it:

DKfromtheBay_0-1646784274098.png

 

When I apply my calculation group to Prior Year, you can see that the base measures shift correctly, however the Average calculation is completely off:

DKfromtheBay_1-1646784345174.png

 

How is this being evaluated such that the components are correctly being impacted by the calculation group but the DIVIDE function, which takes the two components as inputs, is not working? Is there some nuance to the evaluation that I'm not aware of?

 

For reference, due to the complexity of my data model, my base calculations for Cost and Count utilize some CROSSFILTER() functions to disable filtering from other tables as well as some USERELATIONSHIP() functions to enable proper filtering of the data (including activating the relationship w/ Date table on Created Date with Calendar Date).

Not sure why this would matter since the underlying aggregates work but the DIVIDE() doesn't.

1 REPLY 1
v-angzheng-msft
Community Support
Community Support

Hi, @DKfromtheBay 

Lack of experience in the use of calculation groups.
An expert who is experienced in using compute groups may be able to help you.
By the way, it would be easier to get help if you could provide more information about this issue.

 

Could you please consider sharing more details about it?  And It would be great if there is a sample file without any sesentive information here.

It makes it easier to give you a solution.

  1. Sample (dummy dataset) data as text, use the table tool in the editing bar
  2. Expected output from sample data
  3. Explanation in words of how to get from 1. to 2.

How to provide sample data in the Power BI Forum

 

How to Get Your Question Answered Quickly

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

Helpful resources

Announcements
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.