The Fabric Capacity App Report has received some mixed reviews regarding its usability. But what if you could query the underlying dataset, load it into a Fabric Lakehouse, and then use standard T-SQL for querying instead.

This is possible with the use of a Fabric notebook and Semantic Link or SemPy!

Prerequisites:

  • The Microsoft Fabric Capacity Metrics App must be installed in your tenant with the necessary access and reside in a Fabric/Premium Capacity Workspace.
  • Semantic Link/SemPy must be installed in your Spark environment.
  • A Lakehouse must be pre-configured to load data into and attached as a default Lakehouse to your notebook (in order to use to_lakehouse_table functionality)

If Semantic Link isn’t installed, you can do so by executing:

%pip install semantic-link

The sample code is designed as a basis for you to customise according to your requirements. For larger tables, consider incrementally pulling the data and appending it to your Lakehouse tables rather than overwriting them.

Please see the sample code in the link below:

Fabric SemPy Notebook

You should now be able to connect to your Lakehouse SQL Endpoint and query using standard T-SQL.

Let me know how you get on!