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.
Hi everyone,
I have a table thar contains, for each product, the corresponding price list with the validity start date and the validity end date:
My goal is to create two columns:
- The first one, CurrentPrice, contains the currently valid price, which is €0,509 for the first product and €4,295 for the second one. Both prices have ValidityEndingDate = 31/12/1799, which means that the price is valid indefinitely;
- The second one, PreviousPrice, contains the price that was valid in the previous month (January 2022), which is (again) €0,509 for the first product and €4,277 for the second one.
Do you know how I can create the two columns? I think I should use ALLEXCEPT to calculate the values for each product, but I don't know how to compare dates to get what I want.
Here is the PBIX file: https://www.dropbox.com/s/he1q3z2s5n9jvss/Price%20Lists.pbix?dl=0
Thank you!
Solved! Go to Solution.
Change that weird 1799/12/31 to a reasonable date such as 2099/12/31,
Excel worksheet formula is already powerful enough,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Change that weird 1799/12/31 to a reasonable date such as 2099/12/31,
Excel worksheet formula is already powerful enough,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@CNENFRNL unfortunately there's a problem. The second measure returns the second most recent price, but my intent is to get the price that was valid one month ago (January 2022), at least for most days of the month, and not only the previous price. I hope I've explained myself.
That's great, thank you!
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |