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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
samc_26
Helper IV
Helper IV

New DAX table with count summary

Hi all, I'm trying to create a new table pulling through some data from an existing table (using a semantic model I don't have power query access to). The columns I want to use are the following:

 

  • Week commencing
  • Order number
  • Area

I've managed to pull through the week commencing with the count of orders and the area for each but it's counted all the orders in the table and repeated them on each line, what I need it to do is show the count for that week and area instead. Can anyone show me how to do this please? Thank you! 


Current table using DAX: 

 

Table = ADDCOLUMNS(
SUMMARIZE(
'Sales',
'Sales'[Week Commencing],
'Sales'[Area]),

"Total orders", CALCULATE(COUNT('Sales'[Order]), FILTER('Sales', 'Sales'[Week Commencing]) ))

 

Week commencingTotal ordersArea
01/04/20253300North
01/04/20253300

East

01/04/20253300South
01/04/20253300West
08/04/20243300North
08/04/20243300

East

08/04/20243300South
08/04/20243300West

 

I need it to look more like this if possible!

 

Week commencingTotal ordersArea
01/04/2025134North
01/04/2025120

East

01/04/202554South
01/04/2025128West
08/04/2024

26

North
08/04/202479

East

08/04/202481South
08/04/2024109West
2 ACCEPTED SOLUTIONS
anilelmastasi
Super User
Super User

Hello @samc_26 

 

SUMMARIZE(...) creates a unique row for each Week Commencing + Area combo.

ALLEXCEPT(...) removes filters on all other columns except Week Commencing and Area, allowing CALCULATE to count only the orders in that slice.

 

Can you try this:

 

Table =
ADDCOLUMNS(
SUMMARIZE(
'Sales',
'Sales'[Week Commencing],
'Sales'[Area]
),
"Total orders",
CALCULATE(
COUNT('Sales'[Order]),
ALLEXCEPT('Sales', 'Sales'[Week Commencing], 'Sales'[Area])
)
)

View solution in original post

mdaatifraza5556
Super User
Super User

Hi @samc_26 

Can you please try the below DAX ?

Table =
ADDCOLUMNS(
SUMMARIZE('Sales', 'Sales'[Week Commencing], 'Sales'[Area]),
"Total Orders", CALCULATE(
COUNT('Sales'[Order]),
ALLEXCEPT('Sales', 'Sales'[Week Commencing], 'Sales'[Area])
)
)


If this answers your questions, kindly accept it as a solution and give kudos.

View solution in original post

5 REPLIES 5
mdaatifraza5556
Super User
Super User

Hi @samc_26 

Can you please try the below DAX ?

Table =
ADDCOLUMNS(
SUMMARIZE('Sales', 'Sales'[Week Commencing], 'Sales'[Area]),
"Total Orders", CALCULATE(
COUNT('Sales'[Order]),
ALLEXCEPT('Sales', 'Sales'[Week Commencing], 'Sales'[Area])
)
)


If this answers your questions, kindly accept it as a solution and give kudos.

Both of these solutions worked so thank you very much! 👏

anilelmastasi
Super User
Super User

Hello @samc_26 

 

SUMMARIZE(...) creates a unique row for each Week Commencing + Area combo.

ALLEXCEPT(...) removes filters on all other columns except Week Commencing and Area, allowing CALCULATE to count only the orders in that slice.

 

Can you try this:

 

Table =
ADDCOLUMNS(
SUMMARIZE(
'Sales',
'Sales'[Week Commencing],
'Sales'[Area]
),
"Total orders",
CALCULATE(
COUNT('Sales'[Order]),
ALLEXCEPT('Sales', 'Sales'[Week Commencing], 'Sales'[Area])
)
)

Hi @anilelmastasi just wondering if you can help me again please as I realised I need to add some filters into this table which I don't need to see on the output but they need to be taken into consideration in the count of order final figure. How do I add filters to the result in this table?

 

I've been googling and experimenting with the code and all I've managed to do is add the columns I need to filter into the table but then that doesn't sum up the orders by week commencing properly, I get multiple copies of week commencing with the figures split out.

 

If you could help me with this I would be very appreciative! Just wish I could do all this myself! Thank you

Thank you very much this worked great, much appreciated!! 👏

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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