Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply

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. 

EvanGetsItDone_0-1686744957526.png


For this scenario, I don't know how am I able to display the values if "Both Magnitude and Period" is selected on the slicer. 
I added the expected result on the screenshot (the table below)

If you have a solution with different approach and logic, feel free to share. 🙂

Let me know if you need more details. 

Thanks!


1 ACCEPTED SOLUTION
danextian
Super User
Super User

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" }
    }
)

 

danextian_3-1686746931483.png

 

the measure

 

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

 

danextian_0-1686746880458.png

danextian_1-1686746895714.png

danextian_2-1686746906662.png

 

Please see attached sample pbix





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

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" }
    }
)

 

danextian_3-1686746931483.png

 

the measure

 

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

 

danextian_0-1686746880458.png

danextian_1-1686746895714.png

danextian_2-1686746906662.png

 

Please see attached sample pbix





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hey,

Thanks for your response, this is a great logic and approach. However I don't think this works if the I use a measure or aggregate (in this case i SUM() the values) on the Switch (FieldValue measure). The grouping seems to only work if the else statement is String like what you did.

EvanGetsItDone_1-1686753326804.png

 



My Bad, I was not able to put the Measure Group on the Column field the reason it was just showing blank. I will accept this as solution as it helped me solved this issue. Thank you!

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.