Forum Discussion
DAX Group By
Hi Guys, need some help with something I'm trying to do with Group by DAX.
Period | Customer | Paying Group | Number Of tickets | Group By |
01/12/2017 | Loren | 1 | 1 | 3 |
01/12/2017 | Loren | 2 | 2 | 3 |
01/12/2017 | Loren | 3 | 3 | 3 |
01/12/2017 | Dror | 2 | 2 | 4 |
01/12/2017 | Dror | 3 | 4 | 4 |
01/12/2017 | Dror | 1 | 3 | 4 |
01/12/2017 | Dror | 6 | 1 | 4 |
The table above shows 2 customers with several paying groups.
The column "Customer Column" shows the number of tickets that each paying group gives to each customer per Period.
I want to create Dynamic column (not measure!), which calculate for each combination of Period && Customer The maximum ticket. (the group by column)
For example, the column "Group By" above shows that at Period 01/12/2017, the maximum tickets that Loren got was 3 tickets.
In addition, I need this column ("Group By") to be dynamic, so if the user will choose to slice "Paying Group", the column "Group By" will change as well.
For example: If the user will slice "Paying Group"=1 the Column "Group By" will show that at Period 01/12/2017, the maximum tickets For Loren was 1 and for Dror 3 tickets.
In addition, I need this column ("Group By") to be dynamic, so if the user will choose to slice "Paying Group", the column "Group By" will change as well.
For example: If the user will slice "Paying Group"=1 the Column "Group By" will show that at Period 01/12/2017, the maximum tickets For Loren was 1 and for Dror 3 tickets.
Period | Customer | Paying Group | Number Of tickets | Group By |
01/12/2017 | Loren | 1 | 1 | 1 |
01/12/2017 | Dror | 1 | 3 | 3 |
Thanks for your help!
4 Replies
- eniX
Helper III
I don't quite understand what you mean by dynamic column. for me: dynamic column = measure. If I understand your requirements correctly you going to need measure, not calculated columns.
- Drors
Resolver III
Hi,
If you can do it with measure it will be great
- AnonymousNot applicable
Hi Drors,
>>In addition, I need this column ("Group By") to be dynamic, so if the user will choose to slice "Paying Group", the column "Group By" will change as well.
Nope, current power bi not support dynamic calculated column/table based on filter/slicer.
Calculated Column/Table Change Dynamically According to Slicer Selection in the Report.
In my opinion, I'd like to suggest you create measure, it can affected by slicer/filter dynamically.
Regards,
Xiaoxin Sheng
- Ashish_Mathur
Super User
Hi,
In your visual, drag Period and Customer and write this measure
=MAX(Data[Number of Tickets])