Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi PowerBI community,
I am a beginner with PowerBI and would like to implement a calculation with condition based on two fact tables.
My current data model looks as below:
The goal here is to get the multiplication results of Rates[Bill Rate] * Actual_Planned[Actual_Hour]
based on the condition of Actual_Planned[Date] within the period defined in Rates table, i.e. Rates[Start] <= Actual_Planned[Date] <= Rates[End]
Below methods have been tried out but without success:
1. Dax: create a measure as below
Rate = CALCULATE(SUM(RELATED(Rate[Bill Rate])*'Actual_Planned[Actual_Hour]),
FILTER(ALL('Actual_Planned'),'Actual_Planned'[Date] <= RELATE('Rate'[END]) &&
'Actual_Planned'[Date] >= RELATED('Rate'[START])))
2. Power Query: merge the two table by Enterprise ID & Role.
However, it looks like Power Query does not allow filter out the rows with column value comparison, i.e. Rates[Start] <= Actual_Planned[Date] <= Rates[End]
I am looking very forward to your input. Any suggestions are welcome.
Thanks a lot for your time.
hi @Iris_ ,
try this:
Rate = CALCULATE(SUMX('Actual_Planned'),(RELATED(Rate[Bill Rate])*'Actual_Planned[Actual_Hour]),
FILTER(ALL('Actual_Planned'),'Actual_Planned'[Date] <= RELATED('Rate'[END]) &&
'Actual_Planned'[Date] >= RELATED('Rate'[START])))
Appreciate a thumbs up if this helps.
Please accept this as the solution if the query is resolved.
Should you itereate over "Master_Employee" Table?
Try [...]SUMX('Master_Employee')[...]
Hey @adudani
thanks a lot for help to check! Unfortunately, it still shows the error with RELATED(...).
I am not sure if there can be an issue with the relationships in the data model. 🤔