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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Need Help with Power bi

I am stuck in one problem in Power Bi, any help would be appreciated.

I have two tables in power BI 1) Account 2) Sales
Account table has two columns 1) id 2) Owner
Sales has four column 1)Sales(YTD) 2)Accid 3) trader 4)Owner
I have built relationship between them by using unique id column from account table and id column from Sales table
Now the situation is that account table owner column represents the owner of the account,
But for that perticular account other owner can also do sales.
Now when I am trying apply filter to filter sales data based on owner it is only giving value for the account of which he is a owner
But I want all the account for which he has made the sales.

Please find sample data
Sales table

TraderYTDAccIDOwner
PASCAL SELTZER04480A27A-46B8-E811-A978-000D3AF49C6CPascal Seltzer
PASCAL SELTZER03AC1D8F1-F89B-EC11-B3FE-000D3A09D328Pascal Seltzer
DANIEL MADIO3,251.107C80A27A-46B8-E811-A978-000D3AF49C6CShaker Droubi
DANIEL MADIO2,595.7237EA4450-D698-E911-A982-000D3AF490CCDaniel Madio
MICHAEL POIRIER4,296.67B3A02A02-2C78-EA11-A811-000D3AF46489Michael Poirier
MICHAEL POIRIER2,595.7037EA4450-D698-E911-A982-000D3AF490CCDaniel Madio
RACHID BELKHADIR4,296.67B3A02A02-2C78-EA11-A811-000D3AF46489Michael Poirier
SHAKER DROUBI9,160.802836F63D-A875-EA11-A811-000D3AF46489Christopher Pratt


Account table

AccIDOwner
4480A27A-46B8-E811-A978-000D3AF49C6CPascal Seltzer
3AC1D8F1-F89B-EC11-B3FE-000D3A09D328Pascal Seltzer
7C80A27A-46B8-E811-A978-000D3AF49C6CShaker Droubi
37EA4450-D698-E911-A982-000D3AF490CCDaniel Madio
B3A02A02-2C78-EA11-A811-000D3AF46489Michael Poirier
2836F63D-A875-EA11-A811-000D3AF46489Christopher Pratt


Thanks for any help in advance.

1 ACCEPTED SOLUTION

10 REPLIES 10
johnt75
Super User
Super User

Try

 

Total sales by trader =
CALCULATE (
    SUM ( Sales[YTD] ),
    REMOVEFILTERS ( Account ),
    TREATAS ( VALUES ( Account[Owner] ), Sales[Trader] )
)

 

Anonymous
Not applicable

Thanks for your time and reply,
It is not working as exepted.

The thing is that I have one table visual with columns Accid from Account table and Sales, One filter with Owner coming from account table,
Now when I am trying to filter data by selecting any owner from filter it is taking Owner from account matching it with owner column in sales table, Instead of that it should match it with Trader column in sales table.
As per above sample, Suppose I am selecting 

Daniel Madio

Than output in table should be------Right

7C80A27A-46B8-E811-A978-000D3AF49C6C
3,251.10

37EA4450-D698-E911-A982-000D3AF490CC

2,595.72

 

It is giving me output as----- Wrong

37EA4450-D698-E911-A982-000D3AF490CC

2,595.72

37EA4450-D698-E911-A982-000D3AF490CC

2,595.70

I've edited my original post to use the correct column.

Anonymous
Not applicable

I've tried by that way but it is giving same value for all the account in table. 

It works for me using the sample data if I put the account id from the sales table in the visual

Anonymous
Not applicable

Yes, that way it will work but I do have some other data  in table, So I have to use accounts from Account table only

It works for me that way too

johnt75_0-1686217647926.png

 

johnt75_1-1686217661597.png

 

johnt75_2-1686217674446.png

 

 

Anonymous
Not applicable

Thanks for everything, But if you can share me PBIX file it will be very helpful!

Here you go

Anonymous
Not applicable

Thanks for The file, Will have a look and let you know

Thanks again 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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