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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

% of total measure

Hello,

 

I am new to Power BI and DAX and am trying to create a simple measure to calculate the %. I have been trying to create a measure to calculate a row total percentage in power Bi and been facing some issues. The % of sales column is achieved by dividing the appropriate sales by total sales for client. e.g => 41% of client sales for 30 days deliquency is achieved by dividing  total sales: 154,479.73/374,843.62 = 41%.

 

I tried to write a code for this but I always get errors like either too few argument was passed or too many arguments were passed in sumx function. 

Client Total Sales 30 Days Delinquent60 Days Delinquent90 Days Delinquent 120+ Days Delinquent
Amount% of client sales Amount% of client sales Amount% of client sales Amount% of client sales 
Redbird $              374,843.62 $     154,479.7341% $                                 220,363.8959%    
Uline $                57,039.9400% $                                   57,039.94     
Morgan $              292,319.3700%0  $  292,319.37100%  
United $              136,128.62 $     136,128.62100%0     

 

 

1 ACCEPTED SOLUTION

Did you leave TP001 out of the Total Sales sum on purpose?  I assume you didn't do this on purpose, so I created this with your example data:

https://drive.google.com/file/d/1KHkDbGlYsb1-CfiMeHiEGYlaR1WL9JYi/view?usp=sharing

View solution in original post

5 REPLIES 5
Cmcmahan
Resident Rockstar
Resident Rockstar

It would help if we could see any applicable code you've tried to write, as well as a redacted sample of the raw data so we can see how you've got it structured.

 

Right now, I'm not sure what the problem you're having is.  The data in the table you've copied here looks correct to me.

If you just want to learn how to build a simple measure to give the %, try following along with this solution: https://community.powerbi.com/t5/Desktop/Dynamic-dashboard-performance-measuring-parameter/m-p/71948...


Anonymous
Not applicable

%.PNG

The blue table is the raw data. 2nd table is what I want to achieve. The percentages in teh second table is what I want to achieve using the DAX code but I haven't been able to write an executable code for the same. 

 

Did you leave TP001 out of the Total Sales sum on purpose?  I assume you didn't do this on purpose, so I created this with your example data:

https://drive.google.com/file/d/1KHkDbGlYsb1-CfiMeHiEGYlaR1WL9JYi/view?usp=sharing

Anonymous
Not applicable

Thank you very much. This is exactly what I was looking for.

I however have one more question. How did you get rid of the % of client sales from the column total? Client.PNG

Oh, haha, I had forgotten I'd done that.

I turned word wrap off for column names and values, and just shrank that column to 0.  If you grab the right edge and drag it out in my version, it will reappear.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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