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.
Cant seem to figure this out
I have a simple sales table
Date of sale / Product name / Sales
I need to keep track of sales for new products for 3 months. So if a product first began selling on January 1st than I need to track it until April 1st.
How can I do this?
Thanks for your help!
Solved! Go to Solution.
Hi @Credo,
Please refer to below DAX to new calculated columns.
first sale time = CALCULATE ( MIN ( table5[Date of sale] ), ALLEXCEPT ( table5, table5[Product name] ) ) 3 months later = DATEADD ( table5[first sale time].[Date], 3, MONTH ) Sum sales = CALCULATE ( SUM ( table5[Sales] ), FILTER ( ALLEXCEPT ( table5, table5[Product name] ), table5[Date of sale] >= table5[first sale time] && table5[Date of sale] < table5[3 months later] ) )
Best regards,
Yuliana Gu
Hi @Credo,
Please refer to below DAX to new calculated columns.
first sale time = CALCULATE ( MIN ( table5[Date of sale] ), ALLEXCEPT ( table5, table5[Product name] ) ) 3 months later = DATEADD ( table5[first sale time].[Date], 3, MONTH ) Sum sales = CALCULATE ( SUM ( table5[Sales] ), FILTER ( ALLEXCEPT ( table5, table5[Product name] ), table5[Date of sale] >= table5[first sale time] && table5[Date of sale] < table5[3 months later] ) )
Best regards,
Yuliana Gu
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 | |
100 | |
78 | |
75 | |
50 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |