I want to filter a power pivot based on location name, below is my query in VBA I am getting error, can someone help here
ActiveSheet.PivotTables(" & PT & ").PivotFields( _
' "[Locations].[Location Name].[Location Name]").VisibleItemsList = Array( _
' "[Locations].[Location Name].&[" & locationname & " ]")
Where PT = Pivot Table and locationname is Location Name
(Defined and derived variables)
ActiveSheet.PivotTables(" & PT & ").PivotFields( _
' "[Locations].[Location Name].[Location Name]").VisibleItemsList = Array( _
' "[Locations].[Location Name].&[" & locationname & " ]")
Where PT = Pivot Table and locationname is Location Name
(Defined and derived variables)