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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

new measure based on column value

I have a pretty much beginner like question:

 

A have a numbers field with sales amounts and my sum/measure must only contain the total amount of sales based on the value of another column. 

 

So for instance:

 

Column A represents my filter value

I want a total sum/measure of Column B based on a specific content in Column A.

 

I dont now if i explained myself correctly but if someone is willing to help i would be glad to provide some more info.

  

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

try smth like

Measure = calculation(sum(ColumnB); FILTER('Table';'Table'[ColumnA]="yourValue"))

do not hesitate to kudo useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

7 REPLIES 7
az38
Community Champion
Community Champion

Hi @Anonymous 

try smth like

Measure = calculation(sum(ColumnB); FILTER('Table';'Table'[ColumnA]="yourValue"))

do not hesitate to kudo useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 thanks for your prompt response;

 

From the best of my knowledge and your answer i did the following based on my data:

 

Measure 2 = CALCULATE(SUM(Financieel[Aantal]; FILTER(Financieel; Financieel[DimTransactionTypeID]=2)))
 
I get an error when i try to push this. any idea where i am going wrong?
az38
Community Champion
Community Champion

Hi @Anonymous 

what kind of error?

i see you dint have a ")" here "SUM(Financieel[Aantal]"

Measure 2 = CALCULATE(SUM(Financieel[Aantal]); FILTER(Financieel; Financieel[DimTransactionTypeID]=2))

do not hesitate to kudo useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 

Great, That did the trick!!! (simple typo)

 

And what if is want to ad 2 values for the SUM, so i want the total of value 1 and value 2

az38
Community Champion
Community Champion

 @Anonymous 

try OR

Measure 2 = CALCULATE(SUM(Financieel[Aantal]); FILTER(Financieel;OR( Financieel[DimTransactionTypeID]=2;Financieel[DimTransactionTypeID]=2)))

  do not hesitate to kudo useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Just a question about the soulution with OR operator.
What is if these values have to be variable.

 

IF DimTransactionTypeI = 1 --> then do the sum(DimTransactionTypeI = 1)

IF DimTransactionTypeI = 2 --> then do the sum(DimTransactionTypeI = 2)

Anonymous
Not applicable

@az38 

And again, thanks.

 

Works great. As a beginner i am very glad with your prompt response and solution! Kudos 👍 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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