Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

dax for sum of string

hi
i am tring to sum all the pos columns the columns are in string format.
i have tried countA as well but didnt work

 

greeshma_0-1619510139791.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

There is a way maybe more complicated, but you can sum the strings of the entire table . Calculate the strings in each column separately and then sum these counts .

For example :

POS 1-1 = COUNTA('The export'[POS 1])

POS 2-1 = COUNTA('The export'[POS 2])

POS 3-1 = COUNTA('The export'[POS 3])

       ……………

POS 11-1 = COUNTA('The export'[POS 11])

 

And then sum these counts

Total = CALCULATE('The export'[POS 1-1]+'The export'[POS 2-1]+'The export'[POS 3-1]+……………… +'The export'[POS 11-1])

You will get the sum of strings in table .

 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous 

There is a way maybe more complicated, but you can sum the strings of the entire table . Calculate the strings in each column separately and then sum these counts .

For example :

POS 1-1 = COUNTA('The export'[POS 1])

POS 2-1 = COUNTA('The export'[POS 2])

POS 3-1 = COUNTA('The export'[POS 3])

       ……………

POS 11-1 = COUNTA('The export'[POS 11])

 

And then sum these counts

Total = CALCULATE('The export'[POS 1-1]+'The export'[POS 2-1]+'The export'[POS 3-1]+……………… +'The export'[POS 11-1])

You will get the sum of strings in table .

 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , use countx in place of count

 

countx('the export', <your current formula>)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

i tried count x it did work as well

greeshma_0-1619511041476.pnggreeshma_1-1619511075630.png

 

@Anonymous , first argument is the table name 

 

refer :

https://theexcelclub.com/dax-count-and-countx-impact-of-using-measures-and-columns/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

i have tried first argument as countx as well
i have shared pbix file

greeshma_1-1619512083745.png

https://drive.google.com/file/d/1qZ5_7fMRh5WE_wDN3DAZFH9G0opTB2vX/view?usp=sharing

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.