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.
Good morning everyone,
With only 2 "date-like" columns, YEAR (i.e: 2018) and WEEK (i.e.: 34), what formula can I use to get sales from year ago same week for each product ?
YEAR WEEK SALES Product
2018 34 1000 A
2017 34 980 A
I need
YEAR WEEK SALES SALES YAG Product
2018 34 1000 980 A
Any idea ?
Many thanks,
Solved! Go to Solution.
Hi @Anonymous ,
You can create your measure like so:
SALES YAG = VAR last_year = SUM ( 'Table'[YEAR] ) - 1 RETURN CALCULATE ( SUM ( 'Table'[SALES] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[Product], 'Table'[WEEK] ), 'Table'[YEAR] = last_year ) )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Hi @Anonymous ,
You can create your measure like so:
SALES YAG = VAR last_year = SUM ( 'Table'[YEAR] ) - 1 RETURN CALCULATE ( SUM ( 'Table'[SALES] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[Product], 'Table'[WEEK] ), 'Table'[YEAR] = last_year ) )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |