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.
Hello, I am working on Power-Bi Dashboard to set up simple table using below. I need to show % of each product and total sales in a Month. I am having Table1. My output should be Table 2.
Here is what I am thinking.
For (1), I added thismeasure TotalSales = CALCULATE(SUM('Table'[Sales]),GROUPBY('Table','Table'[Month])). But this is not working.
If i am selecting only month column then , i see my measure is working. But If i add product it is not working. My Total sales column should display total sales in month having Month and Product columns in my view.
Any help or any better idea?
Table1. Data Available
Month | Product | Sales |
JUNE | A | 100 |
JUNE | B | 120 |
JUNE | C | 20 |
JULY | A | 30 |
JULY | B | 150 |
JULY | C | 80 |
Table2. Data with New measures.
Month | Product | Sales | Total Sales | % Sales |
JUNE | A | 100 | 240 | 41.67% |
JUNE | B | 120 | 240 | 50.00% |
JUNE | C | 20 | 240 | 8.33% |
JULY | A | 30 | 260 | 11.54% |
JULY | B | 150 | 260 | 57.69% |
JULY | C | 80 | 260 | 30.77% |
Solved! Go to Solution.
Thanks. I figured it out. CALCULATE(SUM('Table'[Sales]),GROUPBY('Table','Table'[Month]),ALL('Table')).
thats it. - I need to tell to DAX exclude all filters. so ALL() did the trick.
How about using 'Matrix' instead of 'Table'?
Thanks. I figured it out. CALCULATE(SUM('Table'[Sales]),GROUPBY('Table','Table'[Month]),ALL('Table')).
thats it. - I need to tell to DAX exclude all filters. so ALL() did the trick.
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 |
---|---|
107 | |
98 | |
78 | |
65 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |