Forum Discussion

taran42's avatar
taran42
Icon for Advocate I rankAdvocate I
1 year ago
Solved

How to Download the Fabric Capacity Metrics Data

How can I download the Fabric Capacity Metrics data?

 

I need to report on usage and cost for my organization and the data in the Fabric Capacity Metrics app has the data I need, however I cannot seem to download the data. I would like to download and store the data, possibly in Snowflake. 

10 Replies

  • If you're familiar with DAX, you can extract the data by executing custom queries in DAX Studio. This method allows you to tailor the data extraction by querying specific metrics, such as CPU usage, resource consumption, and user activity, based on the relevant time points and capacity IDs. Once you've extracted the data, you can store it in a database like Snowflake for further reporting.

    Here is a good tuto to follow : https://pbi-guy.com/2024/03/30/how-to-extract-data-from-the-fabric-metrics-app-part-1/

    You can use the Power BI REST API to execute DAX queries and extract the data you need. This is useful for retrieving specific metrics, but keep in mind that it has a limitation of 1 million rows per query. For large datasets, you may need to implement pagination or use other approaches like paginated reports​.

     

    Extracting data from fabric capacity metrics app - Microsoft Fabric Community

    Fabric Capacity metrics data REST API or alternate... - Microsoft Fabric Community

     

    For more automated, periodic data extraction, you can set up a flow using Power Automate or leverage Fabric pipelines or Python notebooks (if you're using Fabric or Databricks) to automate the process

    How to extract data from the Fabric Metrics App – Part 1 – PBI Guy (pbi-guy.com)

    • taran42's avatar
      taran42
      Icon for Advocate I rankAdvocate I

      Hi Amira. Thanks for the quick response. I did attempt to extract the data using the first link you provided, but could not get it to work properly.

       

      I did try connecting directly to the semantic model in PBI desktop, which somewhat worked. It was fine until I brought in a second data source, which changed the connection from live to DirectQuery. Then it would only give me data from the default capacity and none of the other capacities.

       

      Is there a more direct way to connect to and work with this data?

      • AmiraBedh's avatar
        AmiraBedh
        Icon for Super User rankSuper User

        what are your requirements ? Can you clarify more what you want to achieve ?

    • kayl-669's avatar
      kayl-669
      Frequent Visitor

      Hi! This solution looks a lot less complicated than the method involving a lot of DAX put together on the pbi-guy website. However the dataframe returned by 

      fabric.read_table("Fabric Capacity Metrics", "MetricsByItemandDay")

       ... and any other Metrics* table is empty for us. My colleague has experimented with the pbi-guy DAX method and apparently that also returns zero results until you pass capacity ID and timepoint parameters. Is something similar going on here?

      • azurepocmain's avatar
        azurepocmain
        Icon for Microsoft Employee rankMicrosoft Employee

        Hi kayl-669,

        I've updated the instructions to specifically include the workspace and dataset IDs rather than just passing variables. Additionally, I utilized the remote parameters, however, the Capacity Metrics workspace still requires capacity, or an exception will be thrown. I hope this resolves the issue. Please keep me posted.  Fabric Capacity Metrics Extraction | fabricpocmain.github.io