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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Mani_1
Frequent Visitor

Distribution of values based on other table

Hi,

Is it possible to distibute the values based on two tables? I have two tables both are connected via Key, by one to many relationship. Now when i use the matrix then i have the result below

Mani_1_0-1693827959504.png

But i want to distibute the revenues values  of x-company into the following:

Mani_1_1-1693828187354.png

The sample data is as follows:

Table1

Mani_1_3-1693828431795.png

Table2

Mani_1_2-1693828347611.png

Thanks in advance

@parry2k @amitchandak @Greg_Deckler 

2 REPLIES 2
amitchandak
Super User
Super User

@Mani_1 ,

New column in Table 2=

var _val = sumx(filter(Table1, Table1[Key] = Table2[Key] && Table1[Compay] = Table2[Invoice Recipent]) , Table1[Revenue])

var _st = sumx(filter(Table2, Table2[Key]= earlier(Table2[Key]) && Table2[Invoice Recipent]=  earlier(Table2[Invoice Recipent])) , Table2[Invoice Amount])

return

divide([Invoice Amount], _st)*_val

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak ,

The code doesn't work.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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