Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I need a help,
I do a a pivot table like this:
And I need transform in something like this, include one more colunm
But using DAX expression, anybody help me?
Thanks a lot
Solved! Go to Solution.
Hi @VRMENDESadq ,
I assume each of the columns you show is a measure on your model, what you need is to add a table with the following setup:
| Category | SortCategory | Measure | MeasureSorting |
| Mes Atual | 1 | Meta Vol. | 1 |
| Mes Atual | 1 | Realizado | 2 |
| Mes Atual | 1 | % Ating. | 3 |
| Acumulado trimestre | 2 | Meta Pos. | 4 |
| Acumulado trimestre | 2 | Pos Acumulado | 5 |
| Acumulado trimestre | 2 | % Ating Pos. | 6 |
| Acumulado trimestre | 2 | Meta Vol. Acumulado | 7 |
| Acumulado trimestre | 2 | Real Vol. Acumulado | 8 |
| Acumulado trimestre | 2 | % Ating. | 9 |
Now add the following measure:
Value Total =
SWITCH(SELECTEDVALUE(Table[MeasureSort]),
1, [Meta Vol.],
2, [Realizado],
3, [% Ating.],
4, [Meta Pos.],
5, [Pos Acumulado],
6, [% Ating Pos],
7, [Meta Vol. Acumulado],
8, [Real Vol. Acumulado],
9, [% Ating.])
Now use the Category and the Measure of the previous table in the columns of the matrix and the measure on the values, should give expected result.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @VRMENDESadq ,
I assume each of the columns you show is a measure on your model, what you need is to add a table with the following setup:
| Category | SortCategory | Measure | MeasureSorting |
| Mes Atual | 1 | Meta Vol. | 1 |
| Mes Atual | 1 | Realizado | 2 |
| Mes Atual | 1 | % Ating. | 3 |
| Acumulado trimestre | 2 | Meta Pos. | 4 |
| Acumulado trimestre | 2 | Pos Acumulado | 5 |
| Acumulado trimestre | 2 | % Ating Pos. | 6 |
| Acumulado trimestre | 2 | Meta Vol. Acumulado | 7 |
| Acumulado trimestre | 2 | Real Vol. Acumulado | 8 |
| Acumulado trimestre | 2 | % Ating. | 9 |
Now add the following measure:
Value Total =
SWITCH(SELECTEDVALUE(Table[MeasureSort]),
1, [Meta Vol.],
2, [Realizado],
3, [% Ating.],
4, [Meta Pos.],
5, [Pos Acumulado],
6, [% Ating Pos],
7, [Meta Vol. Acumulado],
8, [Real Vol. Acumulado],
9, [% Ating.])
Now use the Category and the Measure of the previous table in the columns of the matrix and the measure on the values, should give expected result.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsAdvance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.