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
dgdgdg122db
Helper II
Helper II

Summarize twice

 

Hello there, 

I want to first group my customers by customer ID,  the number of orders, and the date  (my TABLE 1)

then group again by customer ID and Orders ( Table 2 )

 

the goal is to find out how many customer ordered more than once ( excluding the orders purchased on the same day)

 

is it possible to write this in one dax formula?

 

Thank you 

dgdgdg122db_0-1635934170994.png

TABLE1 = SUMMARIZE(Orders,Orders[Document Date],Orders[CustomerID],"Occurrence",DISTINCTCOUNT(Orders[Sales document]))
 
dgdgdg122db_1-1635934200778.png

 

Table 2 = SUMMARIZE(TABLE1,TABLE1[CustomerID],"Occurrence2",COUNT(TABLE1[CustomerID]))
1 REPLY 1
VahidDM
Super User
Super User

Hi @dgdgdg122db 

 

Try this:

TABLE1 =
VAR _A =
    SUMMARIZE(
        Orders,
        Orders[Document Date],
        Orders[CustomerID],
        "Occurrence", DISTINCTCOUNT( Orders[Sales document] )
    )
RETURN
    SUMMARIZE( _A, [CustomerID], "Occurrence2", COUNTX( _A, [CustomerID] ) )

 

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

Appreciate your Kudos!!

 

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.

Top Solution Authors