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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Sudharshan1919
Helper III
Helper III

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.

Someone please help me on the above conition.

 

Thanks

1 REPLY 1
amitchandak
Super User
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
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors