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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Ito_c
Frequent Visitor

SUMX plus ALLEXCEPT returning a wrong value

Hi, I'm working in a small dataset with twelve fiscal weeks. So, I need to sum the values from CalculatedMeasure1 for the CalculatedMeasure2 by Fiscal Week, but the SUMX plus ALLEXCEPT is not working to return expected result. 

 

The dataset:

Fiscal WeekCalculatedMeasure1 (percentile)CalculatedMeasure2 (expected result)
2022_F0530%115%
2022_F0560%115%
2022_F0525%115%


For the 
For the CalculatedMeasure1 I'm only divide the Consumed by Budget to return the percentile consumed (not all columns in the table to simplify).

For the CalculatedMeasure2 I'm trying 

 

CalculatedMeasure2 = 

CALCULATE(SUMX('Table','Table'[CalculatedMeasure1]),

ALLEXCEPT('Table','Table'[Fiscal Week])

)
 
I'm not sure if this is returning the sum of other Fiscal Weeks in the dataset, but the result is 40686%
 

 

1 ACCEPTED SOLUTION
Ito_c
Frequent Visitor

I could solve step back on the dataset and use CTE (Commom Table Expression) in SQL Server side. So, based in solution outside of Power BI DAX, I think the solution is the same in DAX, create a temp table and then apply measure in the aggregated temp table.  

View solution in original post

3 REPLIES 3
Ito_c
Frequent Visitor

I could solve step back on the dataset and use CTE (Commom Table Expression) in SQL Server side. So, based in solution outside of Power BI DAX, I think the solution is the same in DAX, create a temp table and then apply measure in the aggregated temp table.  

Anonymous
Not applicable

Hi @Ito_c ,

 

Try this:

CalculatedMeasure2 =
SUMX (
    ALLEXCEPT ( 'Table', 'Table'[Fiscal Week] ),
    'Table'[CalculatedMeasure1]
)

Or

CalculatedMeasure2 =
SUMX (
    FILTER (
        'Table',
        'Table'[Fiscal Week] = SELECTEDVALUE ( 'Table'[Fiscal Week] )
    ),
    'Table'[CalculatedMeasure1]
)

 

Best Regards,

Jay

Hi @Anonymous , both not work. The first return the same value mentioned 40686% and the second return blank.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.