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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
AnthonyH28
Helper I
Helper I

Measure results not filtering/are duplicating incorrectly

This is probably easier for one of you to explain than for me to word!

I have a table where I combine two different sets of data into one. 

AnthonyH28_0-1612985603465.png

 


These values above exist in a table, meaning that 1ST AYD CORP shows up twice but they are identified by their Type. Type denotes the kind of sales it was, Direct or Trace.

I wrote this measure to only sum up the Trace Sales:

CALCULATE(SUM(DirectTrace[EXT Price]),DirectTrace[Type] = "T")

However, when I add that to the table, instead of it only showing up on the line there Type is T, it shows for both T and D
Primary_Customer    Type     EXT Price      Trace Sales
1ST AYD CORP           D         97,464.41      4,367.62
1ST AYD CORP           T            4,367.62      4,367.62

What I need is this:
Primary_Customer    Type     EXT Price      Trace Sales
1ST AYD CORP           D         97,464.41
1ST AYD CORP           T            4,367.62      4,367.62

I need the measure to only show up if the criteria in the measure is met. Theres thousands of customers in this table but I feel like this should be pretty easy since I have a field to identify what is what.
 
1 ACCEPTED SOLUTION
AnthonyH28
Helper I
Helper I

Ugh. Well I will leave the solution here for anyone else who makes this comical mistake.

Heres what I needed to do to the formula:

CALCULATE(SUM(DirectTrace[EXT Price]), FILTER(DirectTrace,DirectTrace[Type] = "T"))

Could someone smarter than me though explain why doing the Filter like this differed from the filter inside the Calculate?

View solution in original post

1 REPLY 1
AnthonyH28
Helper I
Helper I

Ugh. Well I will leave the solution here for anyone else who makes this comical mistake.

Heres what I needed to do to the formula:

CALCULATE(SUM(DirectTrace[EXT Price]), FILTER(DirectTrace,DirectTrace[Type] = "T"))

Could someone smarter than me though explain why doing the Filter like this differed from the filter inside the Calculate?

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!