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
ovonel
Post Prodigy
Post Prodigy

delete unused measures in cube without breaking pbix?

I have 3 .pbix  files that consume live from a SSAS cube.

 

The .bim cube has thousands of measures (most of them not used at all).

 

My goal is to delete the unused measures in the .bim (without breaking any visual in the .pbix).

 

Is there a way of opening the 3 .pbix and extracting all the measures/columns used? (or a way of seeing in the .bim which measures are unused?

 

Ps: each .pbix has 15 pages, so its hard to do it manually.

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

To know if a SSAS measure is used you would have to enumerate all visuals across all pages in each of the PBIX files and fetch the query definition for each of the queries. Then you would have to check if any of the measures is mentioned.

 

The closest you can get to that is Get pages and visuals in a Power BI embedded analytics application | Microsoft Docs

 

As you probably know, a PBIX file is an archive. If you look inside it the Report\Layout file has JSON-y data about the visuals. It does not have the queries though, only the queryName.

 

lbendlin_0-1659831182279.png

If you pretty up that JSON you can sort of glimpse the fields that are shown in the visual. 

lbendlin_1-1659831697405.png

But the query itself is not there. Not sure where to look for that. I guess the only remedy would be to run DMV queries against the XMLA endpoint (either the local SSAS server or the service dataset)

 

select * from $SYSTEM.TMSCHEMA_MEASURES

 

And then you can judge if your SSAS measures are used in any of the DAX measures.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

To know if a SSAS measure is used you would have to enumerate all visuals across all pages in each of the PBIX files and fetch the query definition for each of the queries. Then you would have to check if any of the measures is mentioned.

 

The closest you can get to that is Get pages and visuals in a Power BI embedded analytics application | Microsoft Docs

 

As you probably know, a PBIX file is an archive. If you look inside it the Report\Layout file has JSON-y data about the visuals. It does not have the queries though, only the queryName.

 

lbendlin_0-1659831182279.png

If you pretty up that JSON you can sort of glimpse the fields that are shown in the visual. 

lbendlin_1-1659831697405.png

But the query itself is not there. Not sure where to look for that. I guess the only remedy would be to run DMV queries against the XMLA endpoint (either the local SSAS server or the service dataset)

 

select * from $SYSTEM.TMSCHEMA_MEASURES

 

And then you can judge if your SSAS measures are used in any of the DAX measures.

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