Forum Discussion
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
| Date | Entries (Text) | Items (Text) | |
| ... | Entry 1 | Item 1 | |
| ... | Entry 2 | Item 2 | |
| ... | Entry 1 | Item 3 | |
| ... | Entry 3 | Item 4 | |
| ... | Entry 2 | Item 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 | ||
- Anonymous2 years ago
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")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!
2 Replies
- AnonymousNot 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")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
Community Champion