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
mivar99
Helper I
Helper I

Percentage total in table using direct query to cube wrong

I have a simple percentage calculation in cube that only shows correct total number in powerbi when i show elements without data on the attribute i dragged in

 

screen2.JPG

screen2.JPG

as you see the 981 mio doesnt change but the percentage does - makes no sense and probelm doesnt exist in excel

 

 

7 REPLIES 7
Greg_Deckler
Super User
Super User

Take a look at this article:

 

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

tx for the input but i dont think its an issue like this.

 

First of all i dont use dax for calculations - i connect to a live multimension cube (maybe powerbi uses dax behind the scenes)

 

I made my calculation inside the cube (since i didnt have any option to do local calculations on live cube connection)

 

and then last but not least. Excel shows it correctly out of the box ?

 

screen3.JPG

The Total line is essentially using DAX behind the scenses to aggregate the column. I would suggest that if it is not aggregating it the way you want to create a measure to do it the way you want.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

and the problem is that i already thought i did and it works in excel - i would have to try to make a different type of calculation in mdx where its already correct.

 

at this point no clue how but ill look more into it.

HI @mivar99,

 

I think this issue may related to different filter logic/calculation on matrix and pivot table side. 

 

As smoupre said, sometimes you need to add filters and additional calculation formula in your measure to make sure the formulas get correct result on 'total' row.

 

For any detail about internal formula calculation process, you can try to contact to power bi dev team for further support.

 

Regards.

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

hI !

 

As i see it its a DAX to MDX powerbi problem

 

Its a super simple straight forward percetntage calculation that works ok in excel that uses "normal" mdx to query the cube

 

I am sure other mdx front end tools would show the same

 

But i will see if the mdx formula can be changed to something that also works in powerbi

 

[Measures].[Disbursement (DKK)]/([Budget].[Indicatorstatus].[All],[Measures].[Disbursement (DKK)])

 

/m

 

 

 

and the number shouldnt change when u say yes to show empty members ? if they are empty they shouldnt affect calculation ? Excel filters out the empty ones automatically and still shows correct percetnage calculation ?

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.