The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Dear all,
I'm trying to count the number of occurence of a value from column "Date" in a list of dates with a semicolon separator in another column "Column B" as below :
Date | Column B |
date1 | date1; date2;date3;date4;date5;date6; ,,,,, |
date2 | date1; date2;date3;date4;date5;date6; ,,,,, |
date3 | date1; date2;date3;date4;date5;date6; ,,,,, |
date4 | date1; date2;date3;date4;date5;date6; ,,,,, |
Can you help me with any ideas, please 🙏
Thank you in advanace for your help !
Regards,
Solved! Go to Solution.
Hello @Betty888,
I created this calculated column which uses two main variables
The first variable
Please let me know if this works, and accept it as a solution if it does. You are kudo is also much appreciated.
Hi, @Betty888
You can create a custom column and use the following M expression in PowerQuery. This formula splits the text in "Column B" by semicolon and counts the number of elements after splitting. It then adds one to the count result. If there is no data after the semicolon, we need to subtract one from it.
= List.Count(Text.Split([Column B], ";"))-1
Here is my preview:
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Betty888
You can create a custom column and use the following M expression in PowerQuery. This formula splits the text in "Column B" by semicolon and counts the number of elements after splitting. It then adds one to the count result. If there is no data after the semicolon, we need to subtract one from it.
= List.Count(Text.Split([Column B], ";"))-1
Here is my preview:
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks a lot !
In fact, your suggested solution counts the number of items, but what I need is to count the number of occurence of value from column "Date" in "Column B".
Regards,
Hello @Betty888,
I created this calculated column which uses two main variables
The first variable
Please let me know if this works, and accept it as a solution if it does. You are kudo is also much appreciated.
Many thanks !
it works for my problem, many many thanks !
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
11 | |
10 | |
10 | |
9 |