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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
JustSayJoe
Advocate IV
Advocate IV

Measure Filtering Scenario

I need help getting around an issue I have with a measure getting filtered incorrectly for my purposes. See below scenario.

 

TABLE_A

Includes columns: [Email Address], [Date], [Order ID], [Product]

 

Measure is [Returning Customers] and has the following code...

  COUNTROWS(FILTER(VALUES('TABLE_A'[Email Address], DISTINCTCOUNT('TABLE_A'[Order ID]) > 1 && DISTINCTCOUNT('TABLE_A'[Product]) > 1))

 

This measure works great when I'm filtering by the Date, but when I filter by the Product it does not display the correct values. I get the why of it happening, but I can't figure out how to make this measure still give me the correct number of returning customers when filtered by Product only. Any help here would be very much appreciated. Thanks!

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@JustSayJoe have you seen this article?

 

I'm sure it will help to solve.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@JustSayJoe you are covered, glad it was helpful.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@JustSayJoe have you seen this article?

 

I'm sure it will help to solve.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you! That article was what I've been searching for over the past 4 days.

parry2k
Super User
Super User

@JustSayJoe share the sample data and the expected output.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

DateOrder IDEmail AddressProduct
8/1/20231[email protected]Thing1
8/2/20232[email protected]Thing2
8/3/20233[email protected]Thing3
8/4/20234[email protected]Thing4
8/5/20235[email protected]Thing5
8/6/20236[email protected]Thing1
8/7/20237[email protected]Thing2

 

 

Expected Outcome of the [Returning Customers] Measure...
When I filter my page by Product for "Thing1", the Returning Customers should be 0.

When I filter my page by Product for "Thing2", the Returning Customers should be 0.

When I filter my page by Product for "Thing3", the Returning Customers should be 1 (because [email protected] previously purchased another Product on 8/1/2023).

When I filter my page by Product for "Thing4", the Returning Customers should be 0 (even though [email protected] has purchased two different products, Thing4 was their first purchased product, so they were not a returning customer yet).

When I filter my page by Product for "Thing5", the Returning Customers should be 1 (because [email protected] previously purchased another Product on 8/4/2023).

 

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors