The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |