Forum Discussion
Calculations on Summarized columns
- 5 years ago
Anonymous I see no one has come back with a more detailed reply and I have a bit more time now, so please see attached pbix file below my signature.
I have created Dimension tables for your for Date, Country and PMN as this will make your life easier in the long run. I referenced the OutboundVolumes table to generate these (see my video on survey data for something similar) but ideally you'd have this in your data source already and can pull into Power BI.
Then I created a simple measure for Total MB:
Total MB = SUM(OutboundVolumes[MB])Then I created a measure to get Total MB for ALL PMN (when you configure the visual correctly this will give you the total per Country and Date);Total MB all PMN =IF([Total MB] <> BLANK(),CALCULATE([Total MB], All(PMN)))Finally, I divided these:% of MB by Total MB all PMN = DIVIDE([Total MB], [Total MB all PMN])Using the Matrix visual, you have your desired column:
Anonymous I see no one has come back with a more detailed reply and I have a bit more time now, so please see attached pbix file below my signature.
I have created Dimension tables for your for Date, Country and PMN as this will make your life easier in the long run. I referenced the OutboundVolumes table to generate these (see my video on survey data for something similar) but ideally you'd have this in your data source already and can pull into Power BI.
Then I created a simple measure for Total MB:
- Anonymous5 years agoNot applicable
wow, great AllisonKennedy . Thanks a lot.
Your detailed explaination and pibx file help me achieve this big requirement (for me 🙂 ).
Your blog is also great, has so much detail.
I want to show the PMNs with 0 Total MB/Total MB all PMN of a Country. I tried the IF clauses, but that brings up all the PMNs. Any way that we can show up 0% for any of the Total is 0 or blank.
Thanks a lot.
I highly appreciate your guidance and support.
- AllisonKennedy5 years ago
Community Champion
Anonymous You're welcome.
In order to show 0% you will either get all PMNs displayed as you have already discovered, or you need to specify which PMNs you want to see somehow. Can you explain this in further detail?
Other option would be to use Power Query - so click 'Transform Data' to open Power Query, then in the Tranform tab > Replace values. Replace null with 0.
This will then carry through to the formula.
- Anonymous5 years agoNot applicable
Hello AllisonKennedy ,
There are few nulls in Country field, which I have filtered out.
The see the issue - the OutboundVolume is merged with TMD table that gives Country. TMD contains all PMNs which may not be in the OutboundVolumes. Those PMNs, even if merged with OutboundVolumes, would contain no data for Dates, MB, or any relevant field. On by filtering Date, dataset could not have those PMNs, as the value for CallDate is null.
Doing a Left Join, I have grabbed the Country and Std Target from the TMD into OutboundVolumes.
It's like, "ALBEM" is for 1/1/21, but not for 1/2/21, so for 1/2/21, it doesn't show ALBEM.
Call Date Call Year Call Month Month Name Month PMN MoU MB TMD.COUNTRY TMD.Std Target 1/1/2021 2021 202101 Jan 1 ALBEM 0.083333 0 Albania 0% 1/1/2021 2021 202101 Jan 1 ALBVF 173.5167 1251.777 Albania 100% 1/1/2021 2021 202101 Jan 1 ALBAM 10.71667 0 Albania 0% 1/1/2021 2021 202101 Jan 1 ALBVF 623.0167 29903.94 Albania 100% 1/1/2021 2021 202101 Jan 1 ALBAM 4935.924 Albania 0% 1/1/2021 2021 202101 Jan 1 ALBAM 0 Albania 0% 1/1/2021 2021 202101 Jan 1 ALBAM 0 Albania 0% 1/2/2021 2021 202101 Jan 1 ALBVF 353.8 10586.44 Albania 100% 1/2/2021 2021 202101 Jan 1 ALBAM 25.33333 12.27256 Albania 0% 1/2/2021 2021 202101 Jan 1 ALBVF 314.6 24669.91 Albania 100% 1/2/2021 2021 202101 Jan 1 ALBAM 3019.622 Albania 0% 1/2/2021 2021 202101 Jan 1 ALBAM 147.5871 Albania 0% 1/2/2021 2021 202101 Jan 1 ALBAM 0 Albania 0% 1/2/2021 2021 202101 Jan 1 ALBAM 0 Albania 0% The Country & Std Target taken from TMD contains:
PMN Country Target ALBEM Albania 0% ALBVF Albania 5% ALBAM Albania 95% Could we possibly show all the partners from the TMD for each date regardless of the data being available in the OutboundVolumes. If there is no data, then we show 0.
Hope this helps.
Thank You,