Forum Discussion
DAX Column for grouping values from same column
Hi,
Need help on getting a tricky problem resolved on the data -
I have the below table combining 4 columns - ID, Name, Scheme & Volume
What I need to do is from the Scheme which has multiple schemes, I need to create a calculated column that will automatically group the schemes and sum up the cost - it might be a permutation/combination methodology, but I am trying to work how I can achieve this - I tried summarise, earlier, Treatas etc and
INPUT:
| ID | Name | Scheme | Volume |
| E2334545 | ABC holding | AAA | 123232 |
| E2334545 | ABC holding | BBB | 23424 |
| E2334545 | ABC holding | CCC | 345345 |
| E2334545 | ABC holding | DDD | 3454345 |
| E2334545 | ABC holding | XXX | 3454345 |
| E2334545 | ABC holding | WWW | 3454345 |
| E567432 | ABC holding | SSA | 354345 |
| E567432 | ABC holding | WDA | 546 |
| E567432 | ABC holding | AAA | 56 |
| E567432 | ABC holding | SAD | 46756 |
| R57655668 | Real Estate | GDC | 46766 |
| R57655668 | Real Estate | SSA | 575857 |
| R57655668 | Real Estate | SAD | 87586 |
| R57655668 | Real Estate | CCC | 8578776 |
| R57655668 | Real Estate | DSA | 544534 |
| H7656555 | Limited Co | RED | 75866 |
| H7656555 | Limited Co | FFF | 35345 |
| H7656555 | Limited Co | XXX | 3535 |
| H7656555 | Limited Co | WWW | 552 |
| T345345334 | Private Institute | YYY | 34534 |
| T345345334 | Private Institute | VBN | 7654 |
| T345345334 | Private Institute | GDC | 6365 |
| T345345334 | Private Institute | SAW | 535 |
| T345345334 | Private Institute | AAA | 5252 |
| T345345334 | Private Institute | CCC | 52425 |
| T345345334 | Private Institute | FFF | 5252 |
OUTPUT:
| Scheme combination | Total Volume |
| AAA-BBB | 1,57,216 |
| SSA-AAA | 10,58,742 |
| WWW-GDC | 35,13,280 |
So basically it should group the combinations from the Scheme & combine the volumes together
Is there any way to achieve this? I am really stuck on this session & would really appreciate any help that comes through.
Thanks
Prath
9 Replies
- johnt75Super User
How about a mapping table so that each Scheme Combination had a row for each Scheme, link the Scheme column from the new table to the Scheme column in your data in a many-to-many relationship. I think that's the only way to define which schemes fit into which combinations
- PrathSableAdvocate II
Tried that doesn't work, can you share a example of it please?
- johnt75Super User
If you have something like
Scheme Combination Scheme AAA-BBB AAA AAA-BBB BBB WWW-GDC WWW
WWW-GDC GDC
with a many-to-many relationship from this table to your scheme table, then your total volume measure could be something like
Total Volume = SUMX( 'Scheme Combination Table',
SUMX( RELATEDTABLE( 'Schemes' ), 'Schemes'[Volume] )
)- PrathSableAdvocate II
That's the main problem I do not have a scheme combination 😪
That is what I am looking to create.
- johnt75Super User
Are you looking to combine every scheme with every other scheme ?