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 All,
I have a tabel with Product, cost, quantity,filedate,brand. I want to calculate previous date cost based on the filedate column.
My calculation is not giving me correct result for cost. I have calculated current cost which takes minimum of a product on the selected date for the brand.
Below is the table.
Product Cost Qty filedate Brand
product1 $101 320 31/10/2023 kellogs
product8 $721 80 31/10/2023 kellogs
product2 $1500 50 29/10/2023 parle
product3 $360 150 28/10/2023 parle
product4 $46 980 26/10/2023 kellogs
Below are my measures.
Measure 1
Measure 2
Hi @alamp ,
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi @Dangar332 ,
Thanks for the response. I used the fromula but it is providing total cost for the product. I think i missed one more filter of manufactures. Let me put a small file so that you could guide me better.
Hi, @alamp
as i understood your problem try below
pre date = MAXX(FILTER(ALL(cost),cost[filedate]<MAX(cost[filedate]) && cost[brand]=MAX(cost[brand])),cost[filedate])
result =
var a = MAXX(FILTER(ALL(cost),cost[filedate]<MAX(cost[filedate]) && cost[brand]=MAX(cost[brand])),cost[filedate])
return
SUMX(FILTER(ALL(cost),cost[filedate]=a),cost[cost])
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
16 | |
15 | |
7 | |
7 |
User | Count |
---|---|
35 | |
31 | |
16 | |
15 | |
12 |