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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dd8zc
Helper I
Helper I

Daily dataset size email

It's possbile to use this SQL to get the dataset size https://docs.microsoft.com/en-us/power-bi/admin/service-premium-large-models#checking-dataset-size

I want this information every morning via email. What's the best approach? Is it better to use powershell, python or even microsoft flow for this?

3 REPLIES 3
lbendlin
Super User
Super User

I would register an app and then go with PowerShell cmdlets.  By the way you need DMV code, not SQL.

Thanks for the answer, @lbendlin, I will check this possibility. 

 

Why should I use DMV, whats the advantage? The linked article mentioned this SQL code:

SELECT * FROM SYSTEMRESTRICTSCHEMA
($System.DISCOVER_STORAGE_TABLE_COLUMNS,
 [DATABASE_NAME] = '<Dataset Name>') //Sum DICTIONARY_SIZE (bytes)

SELECT * FROM SYSTEMRESTRICTSCHEMA
($System.DISCOVER_STORAGE_TABLE_COLUMN_SEGMENTS,
 [DATABASE_NAME] = '<Dataset Name>') //Sum USED_SIZE (bytes)

 

There is no choice, you have to use DMV. It is a very limited subset of SQL.

 

Dynamic Management Views (DMVs) in Analysis Services | Microsoft Docs

 

The first query has no size information. The second one can be used as

 

SELECT DIMENSION_NAME, USED_SIZE FROM SYSTEMRESTRICTSCHEMA
($System.DISCOVER_STORAGE_TABLE_COLUMN_SEGMENTS,
[DATABASE_NAME] = '<dataset name>')

 

but then you have to do the aggregations yourself. DMV doesn't support any aggregations.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors