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.
Hello
I am looking count the number of times "CustomerX" appears in a single column on a given date. For Example, Bob appears twice on 11/13 and once on 11/14.
I have tried using COUNTX and SUMX but it counted all occurences instead of just for a single date. Once the occurence for the date is found I would like to create a new column or measure that shows if the occurence in one day is greater than 2 it populates column as "Frequent"
Date - Employee Name - Customer Name
11/13/2020 | Employee 1 | Bob |
11/13/2020 | Employee 2 | Jen |
11/13/2020 | Employee 3 | Bob |
11/13/2020 | Employee 4 | Max |
11/14/2020 | Employee 3 | Bob |
Solved! Go to Solution.
@Anonymous
Add the following code as new column:
Occurrence =
IF(
COUNTROWS(
FILTER(
Table01,
Table01[Customer Name] = EARLIER(Table01[Customer Name]) &&
Table01[Date] = EARLIER(Table01[Date])
)
) > 2,
"Frequent"
)
If you need a measure, then add a table visual, keep Date and Customer name then add the following measure
Occurrence Measure = IF( COUNTROWS(Table01) > 2 , "Frequent")
________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Anonymous
Add the following code as new column:
Occurrence =
IF(
COUNTROWS(
FILTER(
Table01,
Table01[Customer Name] = EARLIER(Table01[Customer Name]) &&
Table01[Date] = EARLIER(Table01[Date])
)
) > 2,
"Frequent"
)
If you need a measure, then add a table visual, keep Date and Customer name then add the following measure
Occurrence Measure = IF( COUNTROWS(Table01) > 2 , "Frequent")
________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thank you very much! The IF function worked for me.
Hi @Anonymous
1. Place Date in the rows of a matrix visual and Customer name in the columns
2. Create this measure and place it in values of the visual:
Measure =
IF ( COUNT ( TAble1[Customer Name] ) > 2, "Frequent" )
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
42 | |
26 | |
22 | |
11 | |
8 |
User | Count |
---|---|
75 | |
50 | |
47 | |
17 | |
17 |