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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
wpf_
Post Prodigy
Post Prodigy

Exporting matrix to excel but total percentage is not correct

Hi I have a matrix in power bi that shows counts of cars on particulate dates and compares the counts from a previous year.  Then i have another column that shows the percentage difference of relating years.  It all shows up correctly in the matrix but when i export it to excel, and when I put together the pivot table, the grand total percentage difference does not show up correctly.  But the grand total counts do and the percentage should be based on the counts, so i'm not sure why it's not showing up correctly.  The percentage shows up correctly outside of the grand totals.  

 

pivottable.png

 

6 REPLIES 6
amitchandak
Super User
Super User

@wpf_ , can you share measure calculations

Can you share sample data and sample output in table format?

@amitchandak ,

 

Let me recreate it with a sample data set and send it to you.  I posted the measure calculations above in the reply to another. Thanks for your help. 

@wpf_ are you adding this as a measure, can you change this

 

=SUMX(
VALUES('Traffic Data'[specificLocation] ),
VAR PrimarySum =
CALCULATE( SUM('Traffic Data'[carCountMethod1] ) + SUM( 'Traffic Data'[carCountMethod2]) )
RETURN
IF( MAX('Traffic Data'[specificLocation]) = 50, PrimarySum *2 , PrimarySum )
)

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k ,

 

I tried but it didnt work. same results.   

parry2k
Super User
Super User

@wpf_ what are the measures? How you are calculation previous year value?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k ,

 

the measures are as follow:

 

Current:  //I have two ways to get car counts.  And I check if the counts are from location "50", I double the counts. 

 

=SUMX(
VALUES('Traffic Data'[specificLocation] ),
VAR PrimarySum =
CALCULATE( SUM('Traffic Data'[carCountMethod1] ) + SUM( 'Traffic Data'[carCountMethod2]) )
RETURN
IF( 'Traffic Data'[specificLocation] = 50, PrimarySum *2 , PrimarySum )
 

Prev:  //I calculate the same data from a year ago (364 days ago to get to the exact day of week (mon, tues etc)).

 

=CALCULATE([Current], DATEADD('Date'[Date], -364, DAY))

 

%:   //the percentage change between years. 

 

= DIVIDE([Current]-[Prev], [Prev])

 

As I said, the calculations look good in power bi, only when I export it to excel in pivot table the grand totals for the percentage is off.  Thanks. 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.