Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
giorgilomidze
Resolver I
Resolver I

pivot after Summing by categories.

So i have data in which i need to create new column which will be the sum of categories and after that i need to pivot them within Power Bi. I tryed Creating Calculated Column cash Paid Sum = CALCULATE(SUM(Table3[cash paid]),ALLEXCEPT(Table3,Table3[Category])) But after i tried to pivot them it showed me tottaly different numbers. For ex  in shwon model from this formula after pivoting i would get in jan for AA category 6*176=1056 becouse it would summerize 176 for each line.    How can i get results shown on the picture. 

Data model Percentage.PNG

1 ACCEPTED SOLUTION
Phil_Seamark
Employee
Employee

Hi @giorgilomidze

 

I got it working by creating the following calculated measure

 

New Measure = DIVIDE(SUM('Table1'[Paid]) , SUM('Table1'[Charged]))

pivot e.png

 

Here is a link to the PBIX file so you can have a play

 

https://1drv.ms/u/s!AtDlC2rep7a-oXqLNxZIwNhHJ9PB

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

2 REPLIES 2
Phil_Seamark
Employee
Employee

Hi @giorgilomidze

 

I got it working by creating the following calculated measure

 

New Measure = DIVIDE(SUM('Table1'[Paid]) , SUM('Table1'[Charged]))

pivot e.png

 

Here is a link to the PBIX file so you can have a play

 

https://1drv.ms/u/s!AtDlC2rep7a-oXqLNxZIwNhHJ9PB

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Thank you! works perfectly. 
If anyone interested this will work for Hierarchies as well. 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.