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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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