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

Summarize while ignoring context

Hi,

 

I'm trying to create a measure that sums FCT_Contract[NumberOfContracts] for each Dim_Customer[HoldingName], but only when there is a holding (i.e.  HoldingName <> Blank()).

 

I have tried this measure, but because it is responds to the values of CustomerName, I don't get my desired output. So, I basically get a duplicate of the 'NumberOfContracts' column, but with a blank space for the customers that are not part of a holding. I have tried playing with ALL and ALLEXCEPT, but I haven't quite figured it out.

 

How can I create a measure that ignores the CustomerName?

 

NumberOfContractsHolding =
var summarizedtable = Summarize(
    filter(FCT_Contract, related( DIM_Customer[Holdingname]) <> Blank()),
    DIM_Customer[Holdingname])
    
var result = sumx(summarizedtable ,[NumberOfContracts])
return result

 

fct_contract.png

 

 

1 ACCEPTED SOLUTION

its ok well im not sure about your dataset but i replicated just the table you provided above 

annonymous1999_0-1691585147523.png


create the new measure

Total by Holding = 
CALCULATE([Number of Contracts],ALLEXCEPT('Table','Table'[HoldingName]),'Table'[Holding] = 1)

 

annonymous1999_1-1691585489334.png

 

 

View solution in original post

3 REPLIES 3
eliasayyy
Memorable Member
Memorable Member

so you do not want the 0 right ? 

 

NumberOfContractsHolding =
var summarizedtable = Summarize(
    filter(FCT_Contract, AND(related( DIM_Customer[Holdingname]) = 1 , related( DIM_Customer[Holdingname]) <> Blank()),
    DIM_Customer[Holdingname],"Amount" , [NumberOfContracts])
    
var result = sumx(summarizedtable ,[Amount])
return result

 

Hi,

Thanks for your time.

I actually want to create the red numbers in my table (I probably should have used a different color...). 

 

I expect that different customers belonging to the same holding will receive the same output, but unfortunately this is not the case. 

Unfortunately this Dax measure also doesn't quite aggregate the date the way I would like.

 

its ok well im not sure about your dataset but i replicated just the table you provided above 

annonymous1999_0-1691585147523.png


create the new measure

Total by Holding = 
CALCULATE([Number of Contracts],ALLEXCEPT('Table','Table'[HoldingName]),'Table'[Holding] = 1)

 

annonymous1999_1-1691585489334.png

 

 

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.

Top Solution Authors