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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Mulitply columns from 2 fact tables (not directly related, but through 2 dimension tables)

Dear PowerBi Community,

i am kinda frustrated here and hope someone can help me with dax. I have a data model that holds two fact tables fct_contract_employee and fct_time_tracking. The tables are related through the dim tables as you can see in the data model. I just cant figure out a dax formula to multiply those two.

This doesnt work because there is no direct relation between the two tables: 

Measure = SUMX(Contracts, Table1[Column1] * RELATED(Table2[Column2])) 

Filtering based on the dim columns doesnt work either: 

SUMX (FCT_TIME_TRACKING_CONTRACT_LEGACY, FCT_TIME_TRACKING_CONTRACT_LEGACY[TRACKED_WORKING_DAYS] * CALCULATE( FCT_CONTRACT_EMPLOYEE[DAILY_RATE], FILTER( FCT_CONTRACT_EMPLOYEE, FCT_CONTRACT_EMPLOYEE[EMPLOYEE_ID] = RELATED( FCT_TIME_TRACKING_CONTRACT_LEGACY[employee_id]) && FCT_CONTRACT_EMPLOYEE[contract_id] = RELATED( FCT_TIME_TRACKING_CONTRACT_LEGACY[contract_id] ) ) ) )

 

 

JonasL_0-1683616590419.png

JonasL_1-1683616616933.png

 

Unbenanntes Bild.png

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can use something like

Amount =
SUMX (
    Contract,
    VAR DailyRate =
        LOOKUPVALUE (
            Employee[Daily rate],
            Employee[ID], Contract[Employee ID],
            Employee[Contract ID], Contract[ID]
        )
    RETURN
        DailyRate * Contract[Hours worked]
)

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You can use something like

Amount =
SUMX (
    Contract,
    VAR DailyRate =
        LOOKUPVALUE (
            Employee[Daily rate],
            Employee[ID], Contract[Employee ID],
            Employee[Contract ID], Contract[ID]
        )
    RETURN
        DailyRate * Contract[Hours worked]
)
Anonymous
Not applicable

Thanks alot John, this one worked for me: 

Measure =
SUMX (
    FCT_TIME_TRACKING_CONTRACT_LEGACY,
    VAR DailyRate =
        LOOKUPVALUE (
            FCT_CONTRACT_EMPLOYEE[DAILY_RATE],
            FCT_CONTRACT_EMPLOYEE[EMPLOYEE_ID], FCT_TIME_TRACKING_CONTRACT_LEGACY[EMPLOYEE_ID],
            FCT_CONTRACT_EMPLOYEE[CONTRACT_ID], FCT_TIME_TRACKING_CONTRACT_LEGACY[CONTRACT_ID]
        )
    RETURN
        DailyRate * FCT_TIME_TRACKING_CONTRACT_LEGACY[TRACKED_WORKING_DAYS]
)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.