Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Letβs celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have two tables;
1_client_rate_history;
2_getTimeLogs;
I have to calculate actual revenue per clΔ±ent=πΈπππππ¦ππ π»ππ’ππ π ππππ‘ πππ πΆπππππ‘βπΆπππππ‘ π ππ‘π with considering rate_effective_date which giving to correct client rate for timelogs_date
please help me!!
1_client_rate_history;
2_getTimeLogs;
3_Result table must be like below;
Solved! Go to Solution.
Hi @ezz ,
You can create a calculated column as below in table '2_getTimeLogs' to get it. What's the relationship between rate_effective_date and timelogs_date? The data timelogs_date should be greater than rate_effective_date?
revenue =
VAR _rate =
CALCULATE (
MAX ( '1_client_rate_history'[client_rate] ),
FILTER (
'1_client_rate_history',
'1_client_rate_history'[client_name] = '2_getTimeLogs'[type]
&& '1_client_rate_history'[project_name] = '2_getTimeLogs'[project_name]
&& '1_client_rate_history'[rate_effective_date] <= '2_getTimeLogs'[timelogs_date]
)
)
RETURN
'2_getTimeLogs'[hours_spent] * _rate
If the above ones can't help you figure out, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @ezz ,
You can create a calculated column as below in table '2_getTimeLogs' to get it. What's the relationship between rate_effective_date and timelogs_date? The data timelogs_date should be greater than rate_effective_date?
revenue =
VAR _rate =
CALCULATE (
MAX ( '1_client_rate_history'[client_rate] ),
FILTER (
'1_client_rate_history',
'1_client_rate_history'[client_name] = '2_getTimeLogs'[type]
&& '1_client_rate_history'[project_name] = '2_getTimeLogs'[project_name]
&& '1_client_rate_history'[rate_effective_date] <= '2_getTimeLogs'[timelogs_date]
)
)
RETURN
'2_getTimeLogs'[hours_spent] * _rate
If the above ones can't help you figure out, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
9 |