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.
I have a dataset which looks like the following:
I want to write a query that returns sales_week, product, username and the SUM of qty only where the SUM is greater than 1.
I would write this in SQL using a subquery as follows:
SELECT tbl1.* FROM (SELECT sales_week, username, product, SUM(qty) AS 'total_qty' FROM sales_data GROUP BY sales_week, username, product) AS tbl1 WHERE tbl1.total_qty > 1
Which would result in the following:
Can someone please help me to generate the same result in Power BI?
Solved! Go to Solution.
Hi @Anonymous
try this:
modeling -> create a newtable
New_table =
FILTER(
SUMMARIZE( Sales_data, 'Sales_data'[sales_week], 'Sales_data'[username], 'Sales_data'[product], "Total qty", sum('Sales_data'[qty])),
[total_qty] > 1)
Hi @Anonymous
try this:
modeling -> create a newtable
New_table =
FILTER(
SUMMARIZE( Sales_data, 'Sales_data'[sales_week], 'Sales_data'[username], 'Sales_data'[product], "Total qty", sum('Sales_data'[qty])),
[total_qty] > 1)
Thank you
Your provided solution worked like a charm!
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |