Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I would like to create a column that counts the number of items in a comma separated striong as follows:
However, the ProjectCount column is currently returning errors (and needs an IF statement added if the project string has no commas the count should be 1).
This then splits the cost based on how many projects for each row. I shall then be splitting/pivoting the table on the projects.
Any help much appreciated.
Solved! Go to Solution.
Hi @BenGWeeks ,
Try using this calculation instead:
if [Projects] = null then 0 else List.Count(List.PositionOf(Text.ToList([Projects]), ",", Occurrence.All)) + 1
Pete
Proud to be a Datanaut!
Hi @BenGWeeks ,
Try using this calculation instead:
if [Projects] = null then 0 else List.Count(List.PositionOf(Text.ToList([Projects]), ",", Occurrence.All)) + 1
Pete
Proud to be a Datanaut!
@BenGWeeks , This power query code used in DAX new column. Please open data transformation and try it there.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 63 | |
| 55 | |
| 42 | |
| 41 | |
| 23 |
| User | Count |
|---|---|
| 166 | |
| 135 | |
| 120 | |
| 79 | |
| 53 |