Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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 Delinquent | 60 Days Delinquent | 90 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.73 | 41% | $ 220,363.89 | 59% | ||||
Uline | $ 57,039.94 | 0 | 0% | $ 57,039.94 | |||||
Morgan | $ 292,319.37 | 0 | 0% | 0 | $ 292,319.37 | 100% | |||
United | $ 136,128.62 | $ 136,128.62 | 100% | 0 |
Solved! Go to 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
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...
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
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?
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.
User | Count |
---|---|
124 | |
108 | |
99 | |
62 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |