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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Summarize 3 tables into one in dax

Hello , i have 3 tables

here you can find the excelsheet : https://1drv.ms/x/s!Ag9tIyk2ofNRjkxmj4B_SvUhrK49?e=gk62w7

accounts, revenues , cost

i have inactive relationship between them

accounts and revenue has an inactive relationship on client name

accounts and cost has an inactive relationship on account name

here are the tables values
Accounts :

Client Name    Account Name
Client  AAccount A
Client  BAccount B
Client  CAccount C
Client  DAccount D

 


Revenue table :

Date            Client Name  Total Revnue
10/3/2022Client A245
10/4/2022Client A391
10/5/2022Client A256
10/6/2022Client A331
10/7/2022Client A325
10/8/2022Client A149
10/9/2022Client A125
10/3/2022Client B212
10/4/2022Client B320
10/5/2022Client B283
10/6/2022Client B208
10/7/2022Client B355
10/8/2022Client B246
10/9/2022Client B315
10/3/2022Client C391
10/4/2022Client C202
10/5/2022Client C134
10/6/2022Client C134
10/7/2022Client C147
10/8/2022Client C262
10/9/2022Client C400
10/3/2022Client D208
10/4/2022Client D371
10/5/2022Client D160
10/6/2022Client D158
10/7/2022Client D217
10/8/2022Client D183
10/9/2022Client D138

 


Cost table:

Date             Account Name    Price Per Client
10/3/2022Account A0.01
10/4/2022Account A0.01
10/5/2022Account A0.01
10/6/2022Account A0.014
10/7/2022Account A0.014
10/8/2022Account A0.014
10/9/2022Account A0.014
10/3/2022Account B0.012
10/4/2022Account B0.012
10/5/2022Account B0.012
10/6/2022Account B0.012
10/7/2022Account B0.015
10/8/2022Account B0.015
10/9/2022Account B0.015
10/3/2022Account C0.01
10/4/2022Account C0.01
10/5/2022Account C0.01
10/6/2022Account C0.01
10/7/2022Account C0.013
10/8/2022Account C0.013
10/9/2022Account C0.013
10/3/2022Account D0.014
10/4/2022Account D0.014
10/5/2022Account D0.014
10/6/2022Account D0.016
10/7/2022Account D0.016
10/8/2022Account D0.016
10/9/2022Account D0.016

 


My desired summarzied table result is:

Date                Client Name    Account  Name    Total Revnue    Cost Per Client
10/3/2022Client AAccount A2450.01
10/4/2022Client AAccount A3910.01
10/5/2022Client AAccount A2560.01
10/6/2022Client AAccount A3310.014
10/7/2022Client AAccount A3250.014
10/8/2022Client AAccount A1490.014
10/9/2022Client AAccount A1250.014
10/3/2022Client BAccount B2120.012
10/4/2022Client BAccount B3200.012
10/5/2022Client BAccount B2830.012
10/6/2022Client BAccount B2080.012
10/7/2022Client BAccount B3550.015
10/8/2022Client BAccount B2460.015
10/9/2022Client BAccount B3150.015
10/3/2022Client CAccount C3910.01
10/4/2022Client CAccount C2020.01
10/5/2022Client CAccount C1340.01
10/6/2022Client CAccount C1340.01
10/7/2022Client CAccount C1470.013
10/8/2022Client CAccount C2620.013
10/9/2022Client CAccount C4000.013
10/3/2022Client DAccount D2080.014
10/4/2022Client DAccount D3710.014
10/5/2022Client DAccount D1600.014
10/6/2022Client DAccount D1580.016
10/7/2022Client DAccount D2170.016
10/8/2022Client DAccount D1830.016
10/9/2022Client DAccount D1380.016


i appreciate your help

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 

You can start building the table by placing all the columns from the Revenue table then you can retrieve the Account Name and Cost per Client as follows

Account Name Measure =
CALCULATE (
    SELECTEDVALUE ( Cost[Account Name] ),
    USERELATIONSHIP ( Revenue[Client Name], Accounts[Client Nsme] ),
    USERELATIONSHIP ( Cost[Account Name], Accounts[Account Nsme] ),
    CROSSFILTER ( Revenue[Client Name], Accounts[Client Nsme], BOTH )
)
Cost per Client Measure =
CALCULATE (
    SELECTEDVALUE ( Cost[Cost per Client] ),
    USERELATIONSHIP ( Revenue[Client Name], Accounts[Client Nsme] ),
    USERELATIONSHIP ( Cost[Account Name], Accounts[Account Nsme] ),
    CROSSFILTER ( Revenue[Client Name], Accounts[Client Nsme], BOTH )
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @Anonymous 

You can start building the table by placing all the columns from the Revenue table then you can retrieve the Account Name and Cost per Client as follows

Account Name Measure =
CALCULATE (
    SELECTEDVALUE ( Cost[Account Name] ),
    USERELATIONSHIP ( Revenue[Client Name], Accounts[Client Nsme] ),
    USERELATIONSHIP ( Cost[Account Name], Accounts[Account Nsme] ),
    CROSSFILTER ( Revenue[Client Name], Accounts[Client Nsme], BOTH )
)
Cost per Client Measure =
CALCULATE (
    SELECTEDVALUE ( Cost[Cost per Client] ),
    USERELATIONSHIP ( Revenue[Client Name], Accounts[Client Nsme] ),
    USERELATIONSHIP ( Cost[Account Name], Accounts[Account Nsme] ),
    CROSSFILTER ( Revenue[Client Name], Accounts[Client Nsme], BOTH )
)

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.