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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Pepe1234
Regular 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
Regular 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

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.