cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gg2023
Frequent Visitor

Data trasnform and calculation

Hi Experts,

 

data set is like below.

Gg2023_0-1686278661065.png

 and i pivot this tables in power query as below. How could i get the amount value with Volumn*Price(with every records multiple)? Please help. 

Gg2023_1-1686278713184.png

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

If fixing the table structure is not allowed, the below may be the one of many ways to solve this.

 

Jihwan_Kim_0-1686280340117.png

 

Jihwan_Kim_1-1686280569742.png

 

Volume X Price: =
SUMX (
    VALUES ( 'Calendar'[Year-Month sort] ),
    CALCULATE ( SUM ( Data[Value] ), Data[KPI] = "Volume" )
        * CALCULATE ( SUM ( Data[Value] ), Data[KPI] = "Price" )
)

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

If fixing the table structure is not allowed, the below may be the one of many ways to solve this.

 

Jihwan_Kim_0-1686280340117.png

 

Jihwan_Kim_1-1686280569742.png

 

Volume X Price: =
SUMX (
    VALUES ( 'Calendar'[Year-Month sort] ),
    CALCULATE ( SUM ( Data[Value] ), Data[KPI] = "Volume" )
        * CALCULATE ( SUM ( Data[Value] ), Data[KPI] = "Price" )
)

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thanks. 

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors