Forum Discussion
insert measures on a pivot
Hi Alberto95 ,
Thanks for the reply from mark_endicott .
Here is the example data I created to use for testing.
|
CodCommesssa |
Ricavi Tot |
Cumulative_MDC_Percent_BI |
Cumulative_Ric_Percent_BI |
|
001 |
1500 |
0.75 |
0.70 |
|
002 |
3000 |
0.90 |
0.95 |
|
003 |
4500 |
0.80 |
0.70 |
|
004 |
6000 |
0.70 |
0.92 |
|
005 |
7500 |
0.85 |
0.90 |
|
006 |
1200 |
0.65 |
0.70 |
|
007 |
3300 |
0.78 |
0.87 |
|
008 |
4700 |
1.22 |
1.22 |
|
009 |
6200 |
0.75 |
0.89 |
|
010 |
7600 |
0.88 |
1.22 |
|
011 |
1300 |
0.68 |
1.22 |
|
012 |
3600 |
0.77 |
0.86 |
|
013 |
4900 |
0.85 |
0.93 |
|
014 |
6100 |
0.72 |
0.88 |
|
015 |
7800 |
0.90 |
0.95 |
In power query, create two columns named Valutazione_MDC_BI, Valutazione_Ric_BI:
Perform a group by operation by these two new columns and calculate their sum Ricavi Tot and count.
Exit and save the data to use the matrix object in power bi desktop.
At this time sum and count are displayed side by side instead of above and below, if you want to display above and below, you can turn on the following option.
The final visual effect is shown below:
The pbix file is attached.
If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Anonymous - Thanks for pointing to the final step switching values to rows, I rarely use Matrix visuals so wasn't aware of this option!
- Alberto951 year agoFrequent Visitor
Thanks to all for replys but also Cumulative_MDC_Percent_BI is a Measure and i can't trasform it to column.
there are 4 measure to create the last measures Valutazione_MDC_BI.
Values of the measures changes each time by the filter and if i created a calculated column, it wouldn't work well.
if you want you can find the pbix here to understand better how does it work:
- mark_endicott1 year agoSuper User
Alberto95 - I'd advise you to have a re-think of how to visualise this. Because what you are trying to do is possible in Power BI only with some very complex and inefficient workarounds.
For example, this blog shows how you can use a measure as a custom label in a bar chart - to acheive the effect of an axis label: https://telefonicatech.uk/blog/pretty-power-bi-creating-dynamic-histograms/
But I couldnt guide you as to how this would be done in a table or matirx with out of the box functionality.
Perhaps this could be done if you used SVG coding or with Deneb, but again this will require a lot of additional learning.
- Alberto951 year agoFrequent Visitor
it's not important how to visualise the results by table, matrix, card, chart,... .
it'd could be fine if i can visualise this results in different cards or in different tables but in this moment i can't.
i tried to filter a new measure but i i have to create for each group a different measure.