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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
garythomannCoGC
Impactful Individual
Impactful Individual

Dax scripting - output to flat file all table column unique data row counts

Wondering how one would go about creating a generic script to take the input name of a dataset.table and output to flat file all the unique data row counts for each column?  

The following is the dax pattern I want to replicate for each table.column.  The result of which would be nice to output to a flat file for analysis.

 

EVALUATE 
GROUPBY('Table',[column], "Count", COUNTX ( CURRENTGROUP (), 1 ))

 

Similar question asked recently and appreciate the advanced tab of dax studio.

Script to show row total counts of all tables of a dataset 

 

Posing these questions another way.  How do we do scripting in dax 'land' similar to how we do in sql 'land' :}

ie  sqlcmd, powershell, bash, etc

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

What you are describing is more suited for a Power Query implementation.  DAX doesn't have any function to manipulate column names, for example.

View solution in original post

2 REPLIES 2
garythomannCoGC
Impactful Individual
Impactful Individual

Multiple queries  This thread on github for dax studio looks promising for a future enhancement.

lbendlin
Super User
Super User

What you are describing is more suited for a Power Query implementation.  DAX doesn't have any function to manipulate column names, for example.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.