Forum Discussion
The code is needed for ABC analysis
- 5 years ago
Hey Anonymous ,
an approach that should always work is the following:
Sum Supplier = VAR vRowSupplier = secondTable[supplier] RETURN CALCULATE( SUM( firstTable[order amount] ), firstTable[supplier] = vRowSupplier )If you would give more details about the relationship also easier approaches could probably be done.
In general for ABC analysis check out the following article:
ABC classification – DAX Patterns
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic - 5 years ago
Hi Anonymous ,
You don't need to create sum measure, when add it to table, it will sum automatically:
If you also want to create a new column ,you could use the following dax :
sum = SUMX ( FILTER ( 'Table', 'Table'[supplier] =Table2[supplier]), 'Table'[order amount] )Final get:
And you also could use the following dax to create a new table ,base on base data table:
Table3 = SUMMARIZE('Table','Table'[supplier],"total",sum('Table'[order amount]))Wish it is helpful for you!
Best Regards
Lucien
- Anonymous5 years ago
Thank you both 😍 I made three counters with your help and all of them worked fine. You no longer have to decide which counter I will use.
Hi Anonymous ,
You don't need to create sum measure, when add it to table, it will sum automatically:
If you also want to create a new column ,you could use the following dax :
sum = SUMX (
FILTER ( 'Table', 'Table'[supplier] =Table2[supplier]),
'Table'[order amount]
)
Final get:
And you also could use the following dax to create a new table ,base on base data table:
Table3 = SUMMARIZE('Table','Table'[supplier],"total",sum('Table'[order amount]))
Wish it is helpful for you!
Best Regards
Lucien