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
faldiwan
Frequent Visitor

ALLSELECTED OR NOT?

Hi all,

 

I need some help please, I have a simple tabular model.
3 tables Portfolio, Position & Date.

The Portfolio table is pretty much a type 1 dimension, Position is a fact table. 

The visual I have contains data from mainly the portfolio table and 2 measures from the Position and a date selected. There is only one filter from the Portfolio table, where they selected 2 companies out of the list of 5 companies.

CompanyInvestmentValueOverall Value
XA1001100
YB10001100

 

This is the data i get and its fine, but the issue is that, I want to be able to keep selecting the 2 companies and if I put an extra filter to select 1 investment, id like to see the overall value stay as 1100 because ive selected the 2 companies.

 

The DAX I have used for Overall Value = CALCULATE( SUM(Value), REMOVEFILTERS(Portfolio), ALLSELECTED(Portfolio[Company]))

This works fine, when all investments appear, but when filtering down to 1, it only gives me the overall value of the company within the investment. Dont understand why? It looks like the below:

CompanyInvestmentValueOverall Value
XA100100

 

Where I would like to keep seeing 1100 in the overall value.

Any help would be much appreciated.

8 REPLIES 8
faldiwan
Frequent Visitor

Hi 

I did CALCULATE( SUM(Amont), Removefilters(InvestmentCode), ALLSELECTED(Company))

Still only returns the amount within the company in the investment

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Position table:

PortfolioIdTotalValue
11000
22000
33000

 

Portfolio table:

IdCompanyInvestment
1Test1Apple
2Test2Amazon
3Test3Arm

 

Report:

CompanyInvestmentTotal ValueOverall
Test1Apple10004000
Test3Arm30004000

 

If I use the following day for Overall:
CALCULATE( SUM(TotalValue), REMOVEFILTERS(Portfolio[Investment]), ALLSELECTED(Portfolio[Company])

 

I get the Report table above, which is great, BUT if i only select "Investment = A" in the filter "Filters on this visual" I only get Overall = 1000, because it looks like its summing within the selected investments.

 

Model example:

Model.png

 

Works when selecting 2 companies and all investments within the companies.

2 companies selected.png

 

When then selecting only 1 investment, should expect to see 4000, but shows only value within the 1 investment selected, need to see the 4000

2 companies selected by 1 investment, should see 4000.png

lbendlin_0-1713875600067.png

 

Hi,

Im expecting to see 4000, not 6. 

 

So ive selected Apple like you did and in the company filters selected Company Test1 & Test2, so i should expect to see the sum of the values for both Test1 & Test2.

 

Your result is returning all 3 companies, when i only selected 2 in my filter

That's a "wash me but don't make me wet"  scenario.  You need to use disconnected tables and measures.

Hi,

 

I was hoping I wouldnt need to remodel, but i assumed that would be the case.

 

Thanks for helping

lbendlin
Super User
Super User

You need to do  REMOVEFILTERS/ALLSELECTED on the investment as well. And if you have a sort column then you need to include that too etc.

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.