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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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.