Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
User | Count |
---|---|
102 | |
91 | |
87 | |
79 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
75 | |
64 |