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
Hello! I would like your help. I am looking to find the last row value per Product. How can I archive that using DAX:
I want the column desirable result, is the last value from the last row:
Week | Product | Score | Desirable result |
Apr 14 - 20, 2019 | ASIN2642 | 61 | 61 |
Apr 21 - 27, 2019 | ASIN2642 | 62 | 61 |
Apr 28 - May 4, 2019 | ASIN2642 | 61 | 62 |
Apr 14 - 20, 2019 | AEO12 | 60 | 60 |
Apr 21 - 27, 2019 | AEO12 | 71 | 60 |
Apr 28 - May 4, 2019 | AEO12 | 63 | 63 |
Apr 14 - 20, 2019 | BIG45 | 65 | 65 |
Apr 21 - 27, 2019 | BIG45 | 60 | 65 |
Apr 28 - May 4, 2019 | BIG45 | 65 | 60 |
Apr 14 - 20, 2019 | ZAZ89 | 69 | 69 |
Apr 21 - 27, 2019 | ZAZ89 | 67 | 69 |
Apr 28 - May 4, 2019 | ZAZ89 | 64 | 67 |
I hope you can help me.
Solved! Go to Solution.
I assume this is a calculated column. If so:
NewCol = VAR PreviousDate_ = CALCULATE ( MAX ( Table1[Week] ), Table1[Week] < EARLIER ( Table1[Week] ), ALLEXCEPT ( Table1, Table1[Product] ) ) RETURN IF ( ISBLANK ( PreviousDate_ ), Table1[Score], CALCULATE ( DISTINCT ( Table1[Score] ), Table1[Week] = PreviousDate_, ALLEXCEPT ( Table1, Table1[Product] ) ) )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hi @DanielSagaon ,
This doesn't appear to show what you are asking. These three are the same product, and I would expect a 61 in each row.
Week | Product | Score | Desirable result |
Apr 14 - 20, 2019 | ASIN2642 | 61 | 61 |
Apr 21 - 27, 2019 | ASIN2642 | 62 | 61 |
Apr 28 - May 4, 2019 | ASIN2642 | 61 | 62 |
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
I assume this is a calculated column. If so:
NewCol = VAR PreviousDate_ = CALCULATE ( MAX ( Table1[Week] ), Table1[Week] < EARLIER ( Table1[Week] ), ALLEXCEPT ( Table1, Table1[Product] ) ) RETURN IF ( ISBLANK ( PreviousDate_ ), Table1[Score], CALCULATE ( DISTINCT ( Table1[Score] ), Table1[Week] = PreviousDate_, ALLEXCEPT ( Table1, Table1[Product] ) ) )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hi!! Thank you so much!! this is exactly what I was looking for!!!!
Really helpful!!
Thank you!!
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 |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
165 | |
116 | |
63 | |
57 | |
50 |