0
votes

I was using SSIS / DAX Studio and I extracted all measures from PowerBI published dataset using a following code:

select 
    MEASURE_NAME as MeasureName
    ,MEASUREGROUP_NAME as TableName
    ,TRIM(EXPRESSION) as DAXExpression
    from $system.MDSCHEMA_MEASURES

and as a result I get all my measures created in PowerBI model with their table names and dax expressions. The problem I'm facing now is basically about searching a particular Substring within results I got. Precisely, within DAXExpression column. So I tried to use contains, containsstring and search functions however always the result is like Error: An unknown DMX expression was encountered at line X, column Y.

I need to extract list of all measures containing SUM in their DAX Expressions. Does anyone know how can I do this via DAX Studio or SQL Server Management Studio?

The following code is not working, and it's variants with mentioned above functions doesn't work as well.

select
    MEASURE_NAME as MeasureName
    ,MEASUREGROUP_NAME as TableName
    ,TRIM(EXPRESSION) as DAXExpression
    
    from $system.MDSCHEMA_MEASURES
    where MEASURE_NAME LIKE "%SUM%" // not working
    order by MEASUREGROUP_NAME
While I love StackOverflow I have to say that for DAX questions I have found more help on community.powerbi.com .Francesco Mantovani