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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

FILTER() in CALCULATE () with VALUES() breaks aggreagtion "scope"

Hello,

 

I have the following Measure: 

 

 

    SUMX (
        'DC Volume',
        DIVIDE (
            CALCULATE ([Delivery Line Count OSR], VALUES ('DC Volume'[FCRateKey])),
            CALCULATE (
                SUM ( Forecast_ProductivityRate[Productivity Rate] ),
                VALUES ( Forecast_ProductivityRate[FCRateKey] )
            )
        )
    )

 

This produces the output of 1646.829 (which is correct) when put in a card visual. To visualize the result:

stefan_h_1-1693470113932.png

If I add a FILTER() expression like this:

 

OSR_FC_Rate_Worked_Hours = 

    SUMX (
        'DC Volume',
        DIVIDE (
            CALCULATE ([Delivery Line Count OSR], VALUES ('DC Volume'[FCRateKey])),
            CALCULATE (
                SUM ( Forecast_ProductivityRate[Productivity Rate] ),
                VALUES ( Forecast_ProductivityRate[FCRateKey] ),
                FILTER (
                    Forecast_ProductivityRate,
                    Forecast_ProductivityRate[From Date] >= [Selected Date SOMONTH]
                        && Forecast_ProductivityRate[To Date] <= [Selected Date EOMONTH]
                        && Forecast_ProductivityRate[ActivityNM / LABROLEV4ID] = "802-91"
                )
            )
        )
    )

 

 

Then the aggregation specififed with VALUES() breaks. Instead of summing up all the results of each division, it uses the total:

stefan_h_2-1693470269179.png

 

How can I avoid this behaviour?

 

The two tables DC Volume and Forecast_ProductivityRate have a many to one relationship (multiple lines in DC Volume relate to one in Forecast) based on FCRateKey (this is also a unique key in Forecast_ProductivityRate).

 

Thanks & br

 

 

 

2 REPLIES 2
technolog
Super User
Super User

I hope this message finds you well. I've noticed that this solution remain unresolved. If any of you have managed to find a resolution to the issue, I kindly request that you share your solution for the benefit of the entire community. Alternatively, if you're still facing challenges, please do let us know as well.

Your insights and updates will greatly assist others who might be encountering the same challenge.

lbendlin
Super User
Super User

What's the point of using VALUES in the CALCULATE?  Should not make any difference?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.