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 Community,
I'm VERY new to DAX/PBI and have a v simple query (I could do it easily in SQL). I've found lots of examples online, but nothing that helps with my query.
Basically I have a daily sales table (example below LEFT) and I want to sum by Product_Category, by day (This value can't change if a filter applies, I want the resulting number to be static), so I want something that would give me the subtotal column in the example on the right. Lets call the table Daily_Sales for example purposes.
Any expert help appreciated.
Thank you!
Solved! Go to Solution.
Hi, Quick tip : to get answers quickly, post the data rather than a picture of the data.
Here's a measure:
Measure = CALCULATE(SUM(Table[Orders]), ALLEXCEPT(Table, Table[Date], Table[Category]))
If you want a calculated column, then
Column = VAR _Category = Table[Category] VAR _Day = Table[Date] RETURN CALCULATE(SUM(Table[Orders]), FILTER(Table, Table[Date] = _Day && Table[Category] = _Category))
@Anonymous ,
Just add the following measure.
Measure = CALCULATE ( SUM ( Table1[Orders] ), ALL ( Table1[Channel] ) )
Hi v-chuncz-msft,
Unfortunatley, that didn't work, it just summed up the whole column of orders.
Any other suggestions?
Hi, Quick tip : to get answers quickly, post the data rather than a picture of the data.
Here's a measure:
Measure = CALCULATE(SUM(Table[Orders]), ALLEXCEPT(Table, Table[Date], Table[Category]))
If you want a calculated column, then
Column = VAR _Category = Table[Category] VAR _Day = Table[Date] RETURN CALCULATE(SUM(Table[Orders]), FILTER(Table, Table[Date] = _Day && Table[Category] = _Category))
Hi HotChilli,
Note taken about pasting the actual data. Your calculated column solution worked a treat!
Thank you so much!
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 |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |