Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
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))
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.
The below blog provides all details :
Hey,
You can check the file size in files:
And for tables as well, you can go and check the view files property of the tables and check the files size
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..
Hope this is helpful. Please let me know incase of further queries.
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 .
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 .
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.
User | Count |
---|---|
24 | |
17 | |
6 | |
5 | |
2 |
User | Count |
---|---|
49 | |
43 | |
18 | |
6 | |
5 |