Forum Discussion
Aggregating Distinct Count measure and Aggregating IF measure
- 7 years ago
Hi Kevin_Gitonga,
Try these two measures, please.
Measure = SUMX ( SUMMARIZE ( 'table', 'table'[ProductCode], 'table'[CustomerCode], "Billing", DISTINCTCOUNT ( 'table'[InvNumber] ) ), [Billing] )
Total Golden Point = SUMX ( SUMMARIZE ( 'table', 'table'[ProductCode], 'table'[CustomerCode], "Golden Point", IF ( DISTINCTCOUNT ( 'table'[InvNumber] ) >= 1, 1, 0 ) ), [Billing] )
Best Regards,
- 7 years ago
Hi,
Try this measure
Billing = if(HASONEVALUE(Data[ProductCode]),DISTINCTCOUNT(Data[InvNumber]),SUMX(SUMMARIZE(VALUES(Data[ProductCode]),[ProductCode],"ABCD",DISTINCTCOUNT(Data[InvNumber])),[ABCD]))
Hope this helps.
- 7 years ago
Hi,
The Golden Points measure can be revised to:
Golden Point = SUMX(SUMMARIZE(GENERATE(VALUES(Sales[CustomerCode]),VALUES(Sales[ProductCode])),[CustomerCode],[ProductCode],"ABCD",if(DISTINCTCOUNT(Sales[InvNumber])>=1,1,0)),[ABCD])
Hope this helps.
Hi,
I'll need to see the PBI file.
Ashish_Mathurhere's the link
https://www.dropbox.com/s/m9rlnrqu9afrial/Sales%20dashboard%20test-%20Copy.pbix?dl=0
- Ashish_Mathur7 years ago
Super User
Hi,
The Golden Points measure can be revised to:
Golden Point = SUMX(SUMMARIZE(GENERATE(VALUES(Sales[CustomerCode]),VALUES(Sales[ProductCode])),[CustomerCode],[ProductCode],"ABCD",if(DISTINCTCOUNT(Sales[InvNumber])>=1,1,0)),[ABCD])
Hope this helps.
- Kevin_Gitonga7 years ago
Helper I
Thanks, this worked well - Ashish_Mathur7 years ago
Super User
You are welcome.
- Kevin_Gitonga6 years ago
Helper I
Ashish_MathurI have a query on this, am I able to filter the products used in this formula using the values in another table.
Golden Point = SUMX(SUMMARIZE(GENERATE(VALUES(Sales[CustomerCode]),VALUES(Sales[ProductCode])),[CustomerCode],[ProductCode],"ABCD",if(DISTINCTCOUNT(Sales[InvNumber])>=1,1,0)),[ABCD])The products to filter in the formula are based on this table where different periods have diffrent products used in the Golden point formula above.
- Ashish_Mathur6 years ago
Super User
Hi,
I am not clear with your question. Please share a simple dataset, explain the business context and show the expected result.