cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
vsgarciap Regular Visitor
Regular Visitor

How to show just the customers with sales en both years

Hey there;

 

I want to show just the customers who have sales records in both years. Example bellow:

MicrosoftTeams-image.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to show just the customers with sales en both years

Hi @vsgarciap ,

 

You can create measure Filter1 like DAX below, then put the Filter1 in the Visual Level Filter of Matrix visual, setting Filter1 as "is not blank".

 

Filter1 =
var record_2018=CALCULATE(MAX(Table1[Sale]),FILTER(ALLSELECTED(Table1), Table1[Cliente] =MAX(Table1[Cliente])&&Table1[Year]=2018))
var record_2019=CALCULATE(MAX(Table1[Sale]),FILTER(ALLSELECTED(Table1), Table1[Cliente] =MAX(Table1[Cliente])&&Table1[Year]=2019))
return
IF(record_2018<>BLANK()&&record_2019<>BLANK(), 1, BLANK())

 

50.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: How to show just the customers with sales en both years

Hi @vsgarciap ,

 

You can create measure Filter1 like DAX below, then put the Filter1 in the Visual Level Filter of Matrix visual, setting Filter1 as "is not blank".

 

Filter1 =
var record_2018=CALCULATE(MAX(Table1[Sale]),FILTER(ALLSELECTED(Table1), Table1[Cliente] =MAX(Table1[Cliente])&&Table1[Year]=2018))
var record_2019=CALCULATE(MAX(Table1[Sale]),FILTER(ALLSELECTED(Table1), Table1[Cliente] =MAX(Table1[Cliente])&&Table1[Year]=2019))
return
IF(record_2018<>BLANK()&&record_2019<>BLANK(), 1, BLANK())

 

50.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

vsgarciap Regular Visitor
Regular Visitor

Re: How to show just the customers with sales en both years

It works perfectly, thank you

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors