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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

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
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

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.

 

Anonymous
Not applicable

It works perfectly, thank you

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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