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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Bennijudge
Regular Visitor

Help needed: Check for matches if higher than 2 = TRUE

Hello community,

 

i have a problem with the following task.

I have a lot of different Entries and Items.

Now i need a function, lets call it KPI, that tells me if one Entry has a match with more than 2 different items. They shall not be equal.

 

Further i want to make this KPI filterable by time so that it is possible to go with a time-slider in Power BI in order to control the time frame in which the KPI is calculated.

 

I really hope someone can help, since i tried so many things but i didn't get all requirements working.

 

Thanks in advance, Best Regards,

Benni

 

 DateEntries (Text)Items (Text)
 ...Entry 1Item 1
 ...Entry 2Item 2
 ...Entry 1Item 3
 ...Entry 3Item 4
 ...Entry 2Item 2
    
Function Output for Entry 1 (for a variable Time-Frame)TRUE  
Function Output for Entry 2 (for a variable Time-Frame)FALSE  
Function Output for Entry 3 (for a variable Time-Frame)FALSE  
    
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Bennijudge 

 

As you hope to make this KPI filterable by a time slicer in Power BI further, I believe using a DAX solution will be better. You can create a measure like below. DISTINCTCOUNT('Table'[Items]) will count the number of distinct items in the scope where it is evaluated. When you change the time frame, the measure will be evaluated according to the new time frame. You can add this measure to a visual along with the [Entries] column. 

KPI Measure = IF(DISTINCTCOUNT('Table'[Items])>1, "TRUE", "FALSE")

vjingzhanmsft_0-1720578554841.png

DISTINCTCOUNT function (DAX) - DAX | Microsoft Learn

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Bennijudge 

 

As you hope to make this KPI filterable by a time slicer in Power BI further, I believe using a DAX solution will be better. You can create a measure like below. DISTINCTCOUNT('Table'[Items]) will count the number of distinct items in the scope where it is evaluated. When you change the time frame, the measure will be evaluated according to the new time frame. You can add this measure to a visual along with the [Entries] column. 

KPI Measure = IF(DISTINCTCOUNT('Table'[Items])>1, "TRUE", "FALSE")

vjingzhanmsft_0-1720578554841.png

DISTINCTCOUNT function (DAX) - DAX | Microsoft Learn

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

dufoq3
Super User
Super User

Hi @Bennijudge, what about this?

 

Before

dufoq3_0-1720539249667.png

dufoq3_1-1720539327240.png

 

After

dufoq3_2-1720539352532.png


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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