Forum Discussion
Aggregating Distinct Count measure and Aggregating IF measure
Hi,
Share the link from where i can download your PBI file.
Ashish_MathurHere's the link to the PBI file I'm using
https://www.dropbox.com/s/m9rlnrqu9afrial/Sales%20dashboard%20test-%20Copy.pbix?dl=0
- Ashish_Mathur7 years ago
Super User
Hi,
Try this measure for Golden Points
Golden Point = if(HASONEVALUE(Sales[CustomerCode]),if(HASONEVALUE(Sales[ProductCode]),if(DISTINCTCOUNT(Sales[InvNumber])>=1,1,0),SUMX(SUMMARIZE(VALUES(Sales[ProductCode]),[ProductCode],"ABCD",if(DISTINCTCOUNT(Sales[InvNumber])>=1,1,0)),[ABCD])),SUMX(SUMMARIZE(VALUES(Sales[CustomerCode]),[CustomerCode],"ABCD",if(DISTINCTCOUNT(Sales[InvNumber])>=1,1,0)),[ABCD]))
Hope this helps.
- Kevin_Gitonga7 years ago
Helper I
hi Ashish_Mathur were you able to have a glance of the linked pbix file I'm using
- Kevin_Gitonga7 years ago
Helper I
Hi, Ashish_Mathur, Thanks for your assistance so far. I tried this and it works well for the row total, however the total of the row total column(Bottom left) is not givign the right answer e.g here it gives 320 while in the real sense it should be 657 when you compute the totals.
- Ashish_Mathur7 years ago
Super User
Hi,
I'll need to see the PBI file.
- Kevin_Gitonga7 years ago
Helper I
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.