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'm new with DAX and I need some help with a measure.
I want to group data by month, product, group and store, and summarize quantity and goals.
These are a sample of my tables:
Stores table
Store | group |
1 | XX |
2 | XX |
3 | YY |
Targets table
Month | Store | Product | Goal |
feb 21 | 1 | A | 5 |
feb 21 | 1 | B | 7 |
feb 21 | 2 | A | 8 |
feb 21 | 2 | B | 7 |
feb 21 | 3 | A | 6 |
feb 21 | 3 | B | 10 |
Sales table
Date | Store | Product | Quantity |
feb 1, 21 | 1 | A | 2 |
feb 2, 21 | 1 | A | 5 |
feb 5, 21 | 1 | B | 3 |
feb 5, 21 | 2 | A | 1 |
I need something like this, filtered by month.
Sum all goals even if there are no sales for some stores yet.
Feb 21
Product | Group | Store | total Quantity | total Goal |
A | 6 | 8 | 19 | |
XX | 3 | 8 | 13 | |
1 | 7 | 5 | ||
2 | 1 | 8 | ||
YY | 3 | 6 | ||
3 | 6 |
I don't have problems if there are some sales for the store, but when a store doesn't have any rows in the sales table, the total goal colum isn't correct.
This is the result I have, the total goal of product A in feb 21 (13) is wrong.
Feb 21
Product | Group | Store | total Quantity | total Goal |
A | 6 | 8 | 13 | |
XX | 3 | 8 | 13 | |
1 | 7 | 5 | ||
2 | 1 | 8 | ||
YY | 3 | __ | ||
3 | __ |
Can anyone help me with this issue?
Thanks
Solved! Go to Solution.
@kaktusit0 , Create a common table of product and join with both tables and then you should be able to analyze
Common tbale
https://www.youtube.com/watch?v=Bkf35Roman8
@kaktusit0 , Create a common table of product and join with both tables and then you should be able to analyze
Common tbale
https://www.youtube.com/watch?v=Bkf35Roman8
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 |
---|---|
45 | |
25 | |
19 | |
16 | |
8 |
User | Count |
---|---|
70 | |
48 | |
45 | |
19 | |
16 |