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
islam_zaki
Regular Visitor

SUMX total incorrect

Hi

 

I need to get the Customer Count bassed on two factors, First is "terminal number" and second is "Transaction Number". each factor repeated in the same invoice with each barcode. 

I create on DAX giving me the correct value for each terminal per store per day. but the total of the day or total of the store for the period is incorrect. I have to retune to filter by date and store. 

Please can anyone help regarding below DAX statement? 

 

Customer Count =
SUMX (
VALUES ( SALESTRANSACTION[TERMINAL #] ),
CALCULATE ( DISTINCTCOUNT ( SALESTRANSACTION[TRX #]))
)
 
 
Thanks 
 
Best Regards
1 ACCEPTED SOLUTION

Firstly, Thanks @amitchandak 

 

The statement you shared it's correctly in addition to table name and two more columns "STORE #" and "AREA".

the Final statement below: 

 

Customer Count =
SUMX (
SUMMARIZE ( SALESTRANSACTION,
SALESTRANSACTION[STORE #],SALESTRANSACTION[AREA],SALESTRANSACTION[TERMINAL #],SALESTRANSACTION[SALES DATE],"_1",
CALCULATE ( DISTINCTCOUNT ( SALESTRANSACTION[TRX #]))),[_1]
)
 
But what I didn't understand "_1", what does it mean...
 
Thanks 
 
Best Regards,
Islam Zaki

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@islam_zaki , Try like

Customer Count =
SUMX (
summarize ( SALESTRANSACTION[TERMINAL #] ,SALESTRANSACTION[Date] ,"_1",
CALCULATE ( DISTINCTCOUNT ( SALESTRANSACTION[TRX #]))),[_1]
)

 

Can you share sample data and sample output in table format?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Firstly, Thanks @amitchandak 

 

The statement you shared it's correctly in addition to table name and two more columns "STORE #" and "AREA".

the Final statement below: 

 

Customer Count =
SUMX (
SUMMARIZE ( SALESTRANSACTION,
SALESTRANSACTION[STORE #],SALESTRANSACTION[AREA],SALESTRANSACTION[TERMINAL #],SALESTRANSACTION[SALES DATE],"_1",
CALCULATE ( DISTINCTCOUNT ( SALESTRANSACTION[TRX #]))),[_1]
)
 
But what I didn't understand "_1", what does it mean...
 
Thanks 
 
Best Regards,
Islam Zaki

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.