March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi team
i have 2 year sales data
i want to calculate LYMTD and LYYTD Till date
(Eg: LYMTD SALES NEED TO CALCULATE 1-10-23 TO 07-10-23
LYYTD SALES NEED TO CALCULATE 01-01-23 TO 07-10-23 )
Inv Date | Item | Qty | Amount |
01-01-2023 | ITEM A | 5 | 670 |
03-01-2023 | ITEM A | 6 | 804 |
03-01-2023 | ITEM B | 4 | 536 |
30-01-2023 | ITEM A | 3 | 402 |
20-02-2023 | ITEM B | 7 | 938 |
06-09-2023 | ITEM A | 3 | 402 |
07-09-2023 | ITEM B | 7 | 938 |
01-10-2023 | ITEM B | 4 | 536 |
06-10-2023 | ITEM A | 8 | 1072 |
06-10-2023 | ITEM B | 4 | 536 |
30-10-2023 | ITEM A | 8 | 1072 |
05-09-2024 | ITEM B | 3 | 402 |
09-09-2024 | ITEM A | 7 | 938 |
01-10-2024 | ITEM B | 5 | 670 |
02-10-2024 | ITEM A | 8 | 1072 |
04-10-2024 | ITEM B | 3 | 402 |
Solved! Go to Solution.
Hi @rajasekar_o - First, ensure you have a proper Date table in your model with continuous dates. You can create one using DAX.
create a relationship between date table and sales table as below:
Proud to be a Super User! | |
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LeanAndPractise(Everyday) ) |
Hi @rajasekar_o - First, ensure you have a proper Date table in your model with continuous dates. You can create one using DAX.
create a relationship between date table and sales table as below:
Proud to be a Super User! | |
@rajasekar_o , First please make sure you have date table then you can create measure
LYMTD Sales =
CALCULATE (
SUM(Sales[Amount]),
DATESBETWEEN (
'DateTable'[Date],
DATE(YEAR(TODAY()) - 1, MONTH(TODAY()), 1),
DATE(YEAR(TODAY()) - 1, MONTH(TODAY()), DAY(TODAY()))
)
)
And one more
LYYTD Sales =
CALCULATE (
SUM(Sales[Amount]),
DATESBETWEEN (
'DateTable'[Date],
DATE(YEAR(TODAY()) - 1, 1, 1),
DATE(YEAR(TODAY()) - 1, MONTH(TODAY()), DAY(TODAY()))
)
)
Proud to be a Super User! |
|
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
80 | |
59 | |
58 | |
44 |
User | Count |
---|---|
182 | |
119 | |
82 | |
68 | |
53 |