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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply

How to calculate Real GDP in DAX

Hi,

 

I have to calculate Real GDP for my Data. 

I calculated Nominal GDP by multiplying price index and Quantity index .

To calculate Real GDP, I need to multiply quantity index of base year with price index of the previous year. I am trying to create a calculated column and measure but not successful. Please provide your inputs. 

Sample data for reference:

Radhika_Kanaka_0-1661304789751.png

I am taking 2001 as the base year . I need to calculate real GDP by multiplying 2001 quantity with 2000 price and also 2001 quantity with 2002 price. Please let me know what logic can be used , as I tried creating calculated columns and did not work .

 

Appreciate your time.

 

Thanks,

Radhika Lanka

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Radhika_Kanaka ,

 

I suggest you to try this measure.

GDP = 
VAR _CY_Quantity = CALCULATE(SUM('Table'[quantity]))
VAR _LY_Price = CALCULATE(SUM('Table'[price]),FILTER(ALL('Table'),'Table'[year] =  MAX('Table'[year])-1))
VAR _NY_Price = CALCULATE(SUM('Table'[price]),FILTER(ALL('Table'),'Table'[year] =  MAX('Table'[year])+1))
RETURN
_CY_Quantity * _LY_Price + _CY_Quantity * _NY_Price

Result is as below.

RicoZhou_0-1661502723314.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Radhika_Kanaka ,

 

I suggest you to try this measure.

GDP = 
VAR _CY_Quantity = CALCULATE(SUM('Table'[quantity]))
VAR _LY_Price = CALCULATE(SUM('Table'[price]),FILTER(ALL('Table'),'Table'[year] =  MAX('Table'[year])-1))
VAR _NY_Price = CALCULATE(SUM('Table'[price]),FILTER(ALL('Table'),'Table'[year] =  MAX('Table'[year])+1))
RETURN
_CY_Quantity * _LY_Price + _CY_Quantity * _NY_Price

Result is as below.

RicoZhou_0-1661502723314.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@amitchandak  thanks much for the help. 

 

Would you also be able to provide details on how to find Nominal GDP, Real GDP ? I have been trying to calculate GDP for the above sample data . 

 

Appreciate your time.

 

Thanks,

Radhika Lanka

amitchandak
Super User
Super User

@Radhika_Kanaka , if you always need the price of 2000

 

a new column

= maxx(filter(Table, Table[Year] =2000) , [Price]) * [Quantity]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.