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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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