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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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