cancel
Showing results for
Did you mean:
Helper II

## Calculated Column Result

Hi All,

Below are my Tables and its data

Table1

S.No   PricingModel   Cost       meterName   Quantity

1         Reservation      0            D4s V3              24

2         Reservation      0            D4s V2              24

3         Reservation      24023    D8s V4              15

4         OnDemand      34567    D4s V2              20

5         OnDemand      94890    D4s V4              36

Table2

S.No   PricingModel    meterName   HourPrice

1          Reservation       D4s V3           2.56

2          Reservation       D4s V2           3.67

3          Reservation       D16s V3        7.89

Now, my calcultion in Table1 what i need is

If the Table1[Pricing Model] = Reservation and Table1[Cost] = 0, then the value in a new calculated column must be Table1[Quantity]*Table2[HourPrice] else it must give the as it is cost value. and for the OnDemand also it must give the respecitve value which is present in Table1

Below must be the output of my above query in Table1

Table1

S.No   PricingModel   Cost       meterName   Quantity    FinalPrice

1         Reservation      0            D4s V3              24              61.44

2         Reservation      0            D4s V2              24              88.08

3         Reservation      24023    D8s V4              15              24023

4         OnDemand      34567    D4s V2              20              34567

5         OnDemand      94890    D4s V4              36              94890

Here FinalPrice is the calculated Column that is needed for me now.

Thanks

Super User

@Sudharshan1919 , a new column in table 1

maxx(filter(Table2, Table2[S.No] = Table1[S.No] && Table2[MeterName] = Table1[MeterName] ) , Table2[HourPrice] ) * Table[Quantity]

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another

Announcements

#### Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

#### Power BI March 2023 Update

Find out more about the March 2023 update.

#### March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors
Top Kudoed Authors