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
ugurgulluev
Helper II
Helper II

Calculation by using values from two different datasets

Hello all,

 

I am new on PowerBI and I started to work on DAX recently. I have a question regarding a formulation in PowerBI.

 

I have two datasets as below:

 

NameYearMonthHours
John Doe2018August20
John Doe2018September15

 

NameYearMonthCharge-out rate
John Doe2018August£22.00
John Doe2018September£20.00

 

What I'm trying to calculate is the monthly revenue of one person, which means that the formula will calculate John Doe's monthly revenue like this:

 

NameYearMonthRevenue
John Doe2018August£440.00
John Doe2018September£400.00

 

The formula needs to check the "Name", "Year" and "Month" in both datasets and needs the calculate the revenue by multiplying the rate with hours based on the conditions above.

 

Much appreciated if you could share your thoughts on this.

 

Thank you and Best regards,

Ugur

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@ugurgulluev,

You can create the following columns in your second table.

Column = LOOKUPVALUE(Table2[Hours],Table2[Name],Table3[Name],Table2[Year],Table3[Year],Table2[Month],Table3[Month])
revenue = Table3[Charge-out rate]*Table3[Column]

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
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

4 REPLIES 4
v-yuezhe-msft
Employee
Employee

@ugurgulluev,

You can create the following columns in your second table.

Column = LOOKUPVALUE(Table2[Hours],Table2[Name],Table3[Name],Table2[Year],Table3[Year],Table2[Month],Table3[Month])
revenue = Table3[Charge-out rate]*Table3[Column]

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ugurgulluev
Helper II
Helper II

Hello all,

 

I am new on PowerBI and I started to work on DAX recently. I have a question regarding a formulation in PowerBI.

 

I have two datasets as below:

 

NameYearMonthHours
John Doe2018August20
John Doe2018September15

 

NameYearMonthCharge-out rate
John Doe2018August£22.00
John Doe2018September£20.00

 

What I'm trying to calculate is the monthly revenue of one person, which means that the formula will calculate John Doe's monthly revenue like this:

 

NameYearMonthRevenue
John Doe2018August£440.00
John Doe2018September£400.00

 

The formula needs to check the "Name", "Year" and "Month" in both datasets and needs the calculate the revenue by multiplying the rate with hours based on the conditions above.

 

Much appreciated if you could share your thoughts on this.

 

Thank you and Best regards,

Ugur

See answer in other thread. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

I would create a column in each table that concatenates those three columns. Then you can relate the two tables (not datasets) to one another and then the measure is very simple to create, just SUM([Hours]) * SUM([Revenue]) essentially.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.