Forum Discussion

EvanGetsItDone's avatar
3 years ago
Solved

Measure that would show Multiple Values based on Slicer Selection

Hello,  I needed help to display both fields with different values within a Measure. Here's the example I created with the same situation.  For this scenario, I don't know how am I able t...
  • danextian's avatar
    3 years ago

    Hi EvanGetsItDone ,

     

    You cannot use a measure and return two measures out of it. What can be done is you add both Magnitude and Period measures to a table but these measures should have a condition in it that returns blank depending on the slicer selection. The measure will only return blank and not hide its column. As a workaround, you can create a separate table (import/enter data/calc) that will hold the measure names and its groupings and you can create a measure using the measure name column from that table. Example calc table

     

    MeasureTable = 
    DATATABLE (
        "Measure Group", STRING,
        "Measure Name", STRING,
        {
            { "Both Magnitude and Period Values", "Magnitude" },
            { "Both Magnitude and Period Values", "Period" },
            { "Magnitude Only", "Magnitude" },
            { "Period Only", "Period" }
        }
    )
    

     

     

    the measure

     

    FieldValue = 
    SWITCH (
        SELECTEDVALUE ( MeasureTable[Measure Name] ),
        "Magnitude", 40050,
        "Period", 13479122.76
    )
    

     

     

    Please see attached sample pbix