cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## Matrix Calculations

I am Trying to Flter some Rows in the Matrix Calcualtion , But unable to do the same.

This is how my matrix Looks Like, I want to filter the rows for Day 1 , Which has similar foods for Lunch/Breakfast and Dinner

 BREAKFAST LUNCH DINNER DAY 1 Burger Burger Burger DAY 2 Burger Pizza Pizza DAY 3 Hot Dog Hot Dog Hot Dog

Any help will be appreciated

Note: The Data set is in 1 Flat Table

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Matrix Calculations

After my test, you may try this way as below:

Assume this is basic data

Step1:

Add a column to adjust whether it has similar foods for Lunch/Breakfast and Dinner each day

`judge = IF(CALCULATE(DISTINCTCOUNT(Table1[Detail]),FILTER(Table1,Table1[Day]=EARLIER(Table1[Day])))>1,"different","similar")`

Step2:

Darg this field into visual level filter or page level filter to filter is different.

Result:

BeforeAfter

or you could use another way:

Add a measure to adjust whether it has similar foods for Lunch/Breakfast and Dinner each day

`Measure = IF( CALCULATE(DISTINCTCOUNT(Table1[Detail]),ALLEXCEPT(Table1,Table1[Day]))>1,"different","similar")`

Then Darg this field into visual level filter to filter is different.

It has the same effect.

Best Regards,
Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Super User IV

## Re: Matrix Calculations

Why not Day 3, which also has similar foods?

### I have book! Learn Power BI from Packt

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Frequent Visitor

## Re: Matrix Calculations

Thanks for Pointing out- Yes Even Third Row .

Community Support Team

## Re: Matrix Calculations

After my test, you may try this way as below:

Assume this is basic data

Step1:

Add a column to adjust whether it has similar foods for Lunch/Breakfast and Dinner each day

`judge = IF(CALCULATE(DISTINCTCOUNT(Table1[Detail]),FILTER(Table1,Table1[Day]=EARLIER(Table1[Day])))>1,"different","similar")`

Step2:

Darg this field into visual level filter or page level filter to filter is different.

Result:

BeforeAfter

or you could use another way:

Add a measure to adjust whether it has similar foods for Lunch/Breakfast and Dinner each day

`Measure = IF( CALCULATE(DISTINCTCOUNT(Table1[Detail]),ALLEXCEPT(Table1,Table1[Day]))>1,"different","similar")`

Then Darg this field into visual level filter to filter is different.

It has the same effect.

Best Regards,
Lin

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

Announcements

#### 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!

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

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

Top Solution Authors
Top Kudoed Authors