Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a table that I want to use to create a report. My goal is to aggregate data by the column DescLvlGroup, which is almost identical to DescCodLvl. The difference is that for aggregation, "Cash" should include (Cash + Out of Order + Other Debts + Commissions).
Row Labels | Sum of value |
Assets | 6500 |
Cash | 4650 |
Investiments | 500 |
Merch 1 | 3000 |
Merch 2 | 1000 |
Grand Total | 15650 |
I successfully created a measure to handle this aggregation, and it works fine. However, when I try to sort DescLvlGroup by _OrderCodLvl, Power BI gives an error because some values in _OrderCodLvl are not unique for each DescLvlGroup.
Is there any way to fix this issue? I can’t figure out how to sort it properly. Any help would be appreciated!
Here's a simplified table i used:
Desc | CodLvl | DescCodLvl | value | _OrderCodLvl | DescLvlGroup |
Company 25 | 4 | Cash | 5000 | 25009999 | Cash |
Company 26 | 3 | Assets | 6500 | 25003000 | Assets |
Company 27 | 2.2 | Merch 1 | 3000 | 25002200 | Merch 1 |
Company 28 | 2.1 | Merch 2 | 1000 | 25002100 | Merch 2 |
Company 29 | 1 | Investiments | 500 | 25001000 | Investiments |
Company 30 | 9 | Out of Order | 0 | 25009999 | Cash |
Company 31 | 6 | Other Debts | -100 | 25009999 | Cash |
Company 32 | 5 | Comissions | -250 | 25009999 | Cash |
Thanks in advance!
Solved! Go to Solution.
@KoroneL Create a new calculated column in your table that concatenates DescLvlGroup and _OrderCodLvl to form a unique value for sorting.
UniqueSortKey = CONCATENATE(DescLvlGroup, _OrderCodLvl)
Use this new UniqueSortKey column to sort your DescLvlGroup column.
Proud to be a Super User! |
|
Thanks for the reply from bhanu_gautam.
Hi @KoroneL ,
It can be sorted during my test.
Have you solved your problem? If it is solved, please mark the reply that help you as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster. If there are any more questions, please feel free to let us know. Thanks a lot!
Best Regards,
Zhu
@KoroneL Create a new calculated column in your table that concatenates DescLvlGroup and _OrderCodLvl to form a unique value for sorting.
UniqueSortKey = CONCATENATE(DescLvlGroup, _OrderCodLvl)
Use this new UniqueSortKey column to sort your DescLvlGroup column.
Proud to be a Super User! |
|
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
6 |