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
WiseLord
Frequent Visitor

How to check the size of data in lakehouse

Hi Everyone, 

I'm new to fabric. I wanted to check the size of all the data in my lake house tables and files. 

I am unable to see the size of the tables and files properties. 

9 REPLIES 9
Nick_Holt
New Member

Here's a short notebook script to recurse through the folder structure and total up the size of everything and count the number of files....

# Define our recursive function to recurse directories listing all files
def list_all_files(directory):
    all_files = []
    items = mssparkutils.fs.ls(directory)
    for item in items:
        if item.isDir:
            all_files.extend(list_all_files(item.path))
        else:
            all_files.append(item)
    return all_files

# Define the path to the Lakehouse
targetWorkspace = '{id of your fabric workspace}'
targetLakehouse = '{id of your fabric lakehouse}'
lakehouse_path = f"abfss://{targetWorkspace}@onelake.dfs.fabric.microsoft.com/{targetLakehouse}/"

# List all files recursively in the Lakehouse
files_df = list_all_files(lakehouse_path) #mssparkutils.fs.ls(lakehouse_path, recursive=True)

# Calculate total size in bytes
total_size_bytes = sum(file.size for file in files_df if file.size is not None)
print(f"Total size of target lakehouse in bytes: ",total_size_bytes)
print (f"Total number of files in target lakehouse: ",len(files_df))

 

Florisz
Frequent Visitor

We have tables only(no files) and the Lakehouse is filled from Microsoft OneLake(within Dataverse).
We just can't get a clear answer where the storage usage of what is shown in Dataverse corresponds with what is shown in Fabric by either using the web interface(Metrics report), PowerShell or OneLake Explorer. All show very different figures from 10Gb(Metrics Report) to 130Gb looking in Dataverse, till almost 500Gb(looking at OneLake Explorer folder size).  Very fuzzy.

NandanHegde
Super User
Super User

The below blog provides all details :

https://blog.fabric.microsoft.com/en-us/blog/getting-the-size-of-onelake-data-items-or-folders?ft=Al...




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com
NandanHegde
Super User
Super User

Hey,

You can check the file size in files:

NandanHegde_0-1707121950972.png

And for tables as well, you can go and check the view files property of the tables and check the files size




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com
Anonymous
Not applicable

Hi @WiseLord ,

As @NandanHegde said you can find the related informayion from UI.

You can also can find the related information from programmatic way too..

vgchennamsft_1-1707214685400.png

 

vgchennamsft_2-1707214749886.png


Hope this is helpful. Please let me know incase of further queries.



Anonymous
Not applicable

Hello @WiseLord ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .

Anonymous
Not applicable

Hello @WiseLord ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
In case if you have any resolution please do share that same with the community as it can be helpful to others .
If you have any question relating to the current thread, please do let us know and we will try out best to help you.
In case if you have any other question on a different issue, we request you to open a new thread .

Hey, I have no more queries, thanks
Anonymous
Not applicable

Hi @WiseLord ,

Glad to know your query was answered. We are always happy to answer your queries.
Please continue using Fabric Community for your further queries.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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