Forum Discussion

GilbertGotfried's avatar
GilbertGotfried
Frequent Visitor
3 months ago
Solved

Blank columns when doing Measure Name Measure Value approach

I put the data in Tableau-like Measure Name and Measure Value format via   MeasureSelector =  DATATABLE(     "Measure Name", STRING, {     {"measure A"}, {"measure B"}     } )   Selected M...
  • v-moharafi-msft's avatar
    v-moharafi-msft
    3 months ago

    Hi GilbertGotfried ,

     

    Thanks for the patience

     

    Dynamic format strings work fine when a measure is used directly in a visual. The issue appears only when the measure is wrapped inside a SWITCH (or similar) expression. In that case, Power BI evaluates the wrapper instead of the original measure, so the original format string (like $ or %) doesn’t carry through, and the wrapper’s formatting is applied.

    If all measures share the same format, you can just format the wrapper measure itself. If you’re dealing with mixed formats, the recommended approach is to use Calculation Groups with SELECTEDMEASURE() and SELECTEDMEASUREFORMATSTRING() to properly preserve dynamic formatting.

     

    Please refer to the provided documentations:

    1) Dynamic format strings in DAX: https://learn.microsoft.com/en-us/dax/dynamic-format-strings

    2) Calculation groups : https://learn.microsoft.com/en-us/power-bi/transform-model/calculation-groups

     

    Best Regards,

    Abdul Rafi