Forum Discussion
islam_zaki
6 years agoRegular 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...
- 6 years ago
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...ThanksBest Regards,Islam Zaki
amitchandak
Super User
6 years agoislam_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?
- islam_zaki6 years agoRegular Visitor
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...ThanksBest Regards,Islam Zaki