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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
garythomannCoGC
Impactful Individual
Impactful Individual

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

Was wondering if there is a straight forward way to script dax (or some other language) ?

Rather than writing the same/similar dax again and again for common needs would nice to put in a bit more effort to create repeatable scripts to do the job now and into the future.

For example, everytime we use a new/unfamiliar dataset it would be nice to fire a script against the dataset to show say total record counts of all the tables within.

A simple dax code got me started now I want to make this generic for all the tables in any dataset.

 

-- show table counts
EVALUATE
UNION (
    ROW ( "Table", "Benefit Realisation List", 
          "Count", COUNTROWS('Benefit Realisation List') ), 
    ROW ( "Table", "Project Achievability Y1 List", 
          "Count", COUNTROWS('Project Achievability Y1 List') ) 
)

-- show column stats for every table
--EVALUATE COLUMNSTATISTICS()

 

I am aware of the tablur editor and c# scripting so maybe this is the only way to go.

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

The problem regarding tabular editor scripts are that they are meant for modifying the model.bim file. Because of this you can't really use them to analyze the model data. However DAX studio's metric pane does what you are looking for pretty well: 

ValtteriN_0-1644823408254.png



E.g. in the "summary" section you can see the amount of tables, columns and the size of the model.


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
garythomannCoGC
Impactful Individual
Impactful Individual

ValtteriN
Super User
Super User

Hi,

The problem regarding tabular editor scripts are that they are meant for modifying the model.bim file. Because of this you can't really use them to analyze the model data. However DAX studio's metric pane does what you are looking for pretty well: 

ValtteriN_0-1644823408254.png



E.g. in the "summary" section you can see the amount of tables, columns and the size of the model.


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.