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

SUMMARIZE and ALLEXCEPT throwing error

Hi all,

 

I'm building up a rather complex measure but I'm getting a strange error thrown at me. Here's the beginning stage of my measure: 

_Measure Draft = maxx(SUMMARIZE(ALLEXCEPT('Table', 'Table'[SERVICE_WEEK]), [SERVICE_WEEK], "Max Date", max('Table'[SERVICE_DATE]), "Count Days", DISTINCTCOUNT('Table'[SERVICE_DATE])), [SERVICE_WEEK])
 
The error I get is "The column 'SERVICE_WEEK' specified in the 'SUMMARIZE' function was not found in the input table." When I replace the ALLEXCEPT with ALL and remove Service Week as the filter exception, the error goes away so I'm guessing the issue has to do with the interaction between the ALLEXCEPT and the SUMMARIZE functions. Does anyone have any ideas of what could be happening?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

https://dax.guide/allexcept/ - If you read this, you'll know immediately why your code returns the error.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

https://dax.guide/allexcept/ - If you read this, you'll know immediately why your code returns the error.
amitchandak
Super User
Super User

@harrame , If you need to group data by week level you don't need all except, because summarize id going to group it

 

Measure Draft = maxx(SUMMARIZE('Table', 'Table'[SERVICE_WEEK], "Max Date", max('Table'[SERVICE_DATE]), "Count Days", DISTINCTCOUNT('Table'[SERVICE_DATE])), [SERVICE_WEEK])

 

what is the benefit SUMMARIZE of MAX on service week? That is not using any inner measure 

 

like, Sum the distinct day by week

Measure Draft = Sumx(SUMMARIZE('Table', 'Table'[SERVICE_WEEK], "Max Date", max('Table'[SERVICE_DATE]), "Count Days", DISTINCTCOUNT('Table'[SERVICE_DATE])), [Count Days])

DataInsights
Super User
Super User

@harrame, the ALLEXCEPT function removes the column SERVICE_WEEK, which makes it unavailable to SUMMARIZE. Try rewriting the SUMMARIZE portion like this:

 

ADDCOLUMNS (
   SUMMARIZE ( 'Table', 'Table'[SERVICE_WEEK] ),
   "Max Date", MAX ( 'Table'[SERVICE_DATE] ),
   "Count Days", DISTINCTCOUNT ( 'Table'[SERVICE_DATE] )
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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 Solution Authors