Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello, friends!
It's the second time I'm posting this, I lost 10 min writing a good question text and for some reason this forum kicked me out and I lost all my text. 😥
OK, let's go:
I'm comparing historical prices among several products, for pricing purposes.
I need a measure that counts how many products had it's price changed, between a date that an user will input (parameter) and the last price.
Let me give you an example:
The user chose a 30 day analysis and today is 12/22/2020.
Product | Store | Price Sold | Date | not part of table, just comment |
Banana | Jhonny's Groceries | 20 | 11/22/2020 | 30 day analysis refer to this date |
Apple | Paul's Groceries | 11 | 11/22/2020 | 30 day analysis refer to this date |
Apple | Jhonny's Groceries | 9 | 11/22/2020 | 30 day analysis refer to this date |
Banana | Jhonny's Groceries | 18 | 11/24/2020 | |
Banana | Jhonny's Groceries | 17 | 11/29/2020 | |
... | ... | ... | ... | |
Apple | Carl's Groceries | 12 | 12/19/2020 | last price entry for 'apple' |
Banana | Jen's Groceries | 15 | 12/20/2020 | last price entry for 'banana' |
So what is expected to happen:
Last Avg Price = CALCULATE(AVERAGE(Sales[Price]),LASTDATE(Sales[Sale_Date]))
That's it!
Can somebody help me, please? Thank you!
@mateus_luzzi , Try a measure like
countx(filter(summarize(Table, Table[Product],"_1", distinctcount(Table[Price Sold])), [_1]>1),[Product])
This will any product that has changed the price
or try like
countx(filter(summarize(Table, Table[Product],"_1", calculate(distinctcount(Table[Price Sold]), allexpcept(Table, Table[Product]))), [_1]>1),[Product])
Hello, friend @amitchandak
I really appreciate your time. Unfortunately it didn't work. Do you have any other suggestions?