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.
Hi all,
I've done bits in batch scripting, VBScripting, VBA. I know Java, HTML, PHP and SQL. For some reason, I am really struggling to understand even the basic concepts of DAX.
I have sales data lets say item_name, sale_price, item_category. All i want to do is sum the total sale_price per item_category. Lets say i have 4 categories. So i want the output to be like this this (totals per category)
Category1 - 15000
Category2 - 21000
Category3 - 3000
Category4 - 6500
then from that I am going to convert the data into percentages. Ie:
Category1 - 32%
Category2 - 46%
Category3 - 6.5%
Category4 - 14%
this takes me literally 1 minute in excel. Yet i've spent 2 hours now trying to get it going in Power BI. The problem I keep having is it just outputs 1 number, the total of everything. I'd give you my attempts so far but i've literally tried writing this 10 different ways (and didn't save all the different ways). This is absolute last way i've tried
% Mix = SUM(Table1[unitprice_exclusive])/CALCULATE(SUM(Table1[unitprice_exclusive]), ALL(Table1[gl_description]))
and
% Mix = SUM(Table1[unitprice_exclusive])/CALCULATE(SUM(Table1[unitprice_exclusive]), ALL(Table1))
Solved! Go to Solution.
Glad to be of help to you. It takes only less than a minute. One more snip to help you.
From Visualization pane>Choose Matrix and plot the columns as per the screenshot
Is this what are you looking for @Anonymous
Yes that is exactly what im after
Glad to be of help to you. It takes only less than a minute. One more snip to help you.
From Visualization pane>Choose Matrix and plot the columns as per the screenshot
okay so your solution is that i shouldn't use DAX for this?
You may probaly land in the same solution using a custom made complex DAX script (not sure though). But if the built-in operation can give you the same result why waste time?
I didnt know it would be complex (and i already knew how to do what you suggested). There is a bunch of other stuff i've been asked to do with the data, I was also hoping to learn more from provided solutions
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |