Forum Discussion

eduardozn's avatar
eduardozn
New Member
1 year ago
Solved

Alias on SummarizeColumns

Hello, I have an excel table DAX query from a PowerBI semantic model. The main issue I have with this is that the table column names all have 'Dmd TPD Snapshot'[columnName]. My goal is to clean the ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi eduardozn ,

    Thank you for reaching out to the Microsoft Fabric Community.

     

    As lbendlin  correctly mentioned, SUMMARIZECOLUMNS maintains column lineage and does not support direct aliasing.
    To achieve your goal  removing table names and formatting column names with underscores we recommend wrapping your SUMMARIZECOLUMNS output with SELECTCOLUMNS to manually rename fields.

    You can also dynamically filter to the current week's Monday using:

    CurrentMonday = TODAY() - WEEKDAY(TODAY(), 2) + 1

    Recommended approach:

    VAR __DS0Core = SUMMARIZECOLUMNS(...your fields...)
    VAR __DS0Renamed = SELECTCOLUMNS(
        __DS0Core,
        "AS_OF_DATE", [AS OF DATE],
        "FINAL_CATEGORY", [FINAL CATEGORY],
        -- and so on
    )
    
    EVALUATE __DS0Renamed
    

    This will give you clean, underscore-formatted column names without table prefixes and apply the dynamic Monday filter as required.

     

    I hope this will resolve your issue, if you need any further assistance, feel free to reach out.

    If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

     

    Thankyou.