Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
Pepe1234
Frequent Visitor

Acumulative inflation

Hi, I'm trying to calculate cumulative inflation, month by month for unit price forecast (DAX not Power Query).

 

I need two columns:

      - one column with cumuative_inflation (I tried with "Productx", but it didn´t work.)

      - another column with Unit_Price_Forecast (last unit_price available in the sales table)*(cumulative_inflation)

 

Can you help me?

 

FORECAST_TABLE

DATEBUSKUINFLATIONQ
1/9/2023PRO34124600137665
1/9/2023RHCE19017003117640
1/9/2023RHCE19017103125000
1/9/2023RHCN190170031,06291268
1/9/2023RHCN190171031,06246497
1/10/2023PRO34124600133480
1/10/2023RHCE19017003117640
1/10/2023RHCE19017103125000
1/10/2023RHCN190170031,06300006
1/10/2023RHCN190171031,06253891
1/11/2023PRO34124600141850
1/11/2023RHCE19017003117640
1/11/2023RHCE19017103125000
1/11/2023RHCN190170031285006
1/11/2023RHCN190171031241197
1/12/2023PRO34124600150219
1/12/2023RHCN190170031,15282156
1/12/2023RHCN190171031,15238785
1/1/2024PRO34124600134875
1/1/2024RHCE190170031,0821600
1/1/2024RHCE190171031,0832400
1/1/2024RHCN190170031,05297897
1/1/2024RHCN190171031,05223526

 

SALES TABLE

 

DATEBUSKUUNIT_PRICEQ
1/8/2023PRO34124600  
1/8/2023RHCE19017003$ 10,015876
1/8/2023RHCE19017103$ 9,022500
1/8/2023RHCN19017003$ 1.000,0262141,2
1/8/2023RHCN19017103$ 1.500,0221847,3
1/7/2023PRO34124600$ 11,033480
1/7/2023RHCE19017003$ 9,517640
1/7/2023RHCE19017103$ 8,525000
1/7/2023RHCN19017003$ 950,0300006
1/7/2023RHCN19017103$ 1.200,0253891
1/6/2023PRO34124600$ 10,541850
1/6/2023RHCE19017003$ 9,017640
1/6/2023RHCE19017103$ 8,125000
1/6/2023RHCN19017003$ 902,5285006
1/6/2023RHCN19017103$ 1.140,0241197

 

I expect something like that:

 

DATEBUSKUINFLATIONQINFLAT_ACUMULUNIT_PRICE_FORECAST
1/9/2023PRO341246001376651,00 $                                11,0
1/9/2023RHCE190170031176401,00 $                                10,0
1/9/2023RHCE190171031250001,00 $                                  9,0
1/9/2023RHCN190170031,062912681,06 $                          1.060,0
1/9/2023RHCN190171031,062464971,06 $                          1.590,0
1/10/2023PRO341246001334801,00 $                                11,0
1/10/2023RHCE190170031176401,00 $                                10,0
1/10/2023RHCE190171031250001,00 $                                  9,0
1/10/2023RHCN190170031,063000061,12 $                          1.123,6
1/10/2023RHCN190171031,062538911,12 $                          1.685,4
1/11/2023PRO341246001418501,00 $                                11,0
1/11/2023RHCE190170031176401,00 $                                10,0
1/11/2023RHCE190171031250001,00 $                                  9,0
1/11/2023RHCN1901700312850061,12 $                          1.123,6
1/11/2023RHCN1901710312411971,12 $                          1.685,4
1/12/2023PRO341246001502191,00 $                                11,0
1/12/2023RHCN190170031,152821561,29 $                          1.292,1
1/12/2023RHCN190171031,152387851,29 $                          1.938,2
1/1/2024PRO341246001348751,00 $                                11,0
1/1/2024RHCE190170031,08216001,08 $                                10,8
1/1/2024RHCE190171031,08324001,08 $                                  9,7
1/1/2024RHCN190170031,052978971,36 $                          1.356,7
1/1/2024RHCN190171031,052235261,36 $                          2.035,1

 

Thanks, Ramiro

 

PBIX EXAMPLE

https://accuratio2015-my.sharepoint.com/:u:/g/personal/consultoria_accuratio2015_onmicrosoft_com/EQO... 

 

DATASOURCE EXAMPLE

https://accuratio2015-my.sharepoint.com/:x:/g/personal/consultoria_accuratio2015_onmicrosoft_com/EdA...

 

 

3 REPLIES 3
Pepe1234
Frequent Visitor

amitchandak
Super User
Super User

@Pepe1234 , Try with a common date table

 


Cumulative_Inflation =
CALCULATE(
PRODUCTX(FORECAST_TABLE, 1 + [INFLATION]),
FILTER(all(Date), Date[DATE] <= max(DAte[DATE]))
)

Unit_Price_Forecast =
VAR LatestPrice = calculate(Max(SALES_TABLE[UNIT_PRICE]), FILTER(all(Date), Date[DATE] = max(DAte[DATE])))
RETURN
[Cumulative_Inflation] * LatestPrice

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.