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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Create a dynamic measure column name

I created a measure that calculates the value based on a selection.  However, I need my measure title to be dynamic as well.

 
Measure = SWITCH(SELECTEDVALUE('Filter'[Column1]),"Selection 1",SUM([Selection 1]),"Selection 2",SUM(Sheet1[Selection 2]),"Selection 3",SUM(Sheet1[Selection 3]))
 
I was the name "Measure" to read whatever filter I am selected on.  Any ideas how I can do this?
 
Output Table (Example when I'm on Selection 1):
NameMeasure
Item 11
Item 21
Item 31

 

Source Table:

NameSelection 1Selection 2Selection 3
Item 1123
Item 2123
Item 3123

 

Selection Table;

Column 1
Selection 1
Selection 2
Selection 3
1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try to create a HeadColumn table as below:

21.PNG

Then try this measure:

Measure = SWITCH(SELECTEDVALUE(HeaderTable[Value]),"_Selection 1",SUM(Source[Selection 1]),"_Selection 2",SUM(Source[Selection 2]),"_Selection 3",SUM(Source[Selection 3]))

Choose [Value] as a slicer, then choose [Value] and this measure as a matrix visual.

When you select one value in slicer, the result shows:

22.PNG

Here is my test pbix file:

pbix 

Hope this can help.

 

Best Regards,

Giotto Zhi

View solution in original post

4 REPLIES 4
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try to create a HeadColumn table as below:

21.PNG

Then try this measure:

Measure = SWITCH(SELECTEDVALUE(HeaderTable[Value]),"_Selection 1",SUM(Source[Selection 1]),"_Selection 2",SUM(Source[Selection 2]),"_Selection 3",SUM(Source[Selection 3]))

Choose [Value] as a slicer, then choose [Value] and this measure as a matrix visual.

When you select one value in slicer, the result shows:

22.PNG

Here is my test pbix file:

pbix 

Hope this can help.

 

Best Regards,

Giotto Zhi

  • Hi. This works perfectly when you have only one measure in a matrix. How can I make it work with multiple measures??
  • Thank you 
Greg_Deckler
Community Champion
Community Champion

Oh, just had an idea. You could achieve this if you used 3 buttons, 3 bookmarks and stacked visuals. So, create a visual that displays only one of your columns. Stack them on top of one another. Use the Bookmarks and Selection panes to create 3 bookmarks where you show only one of the visuals and hide the other 2. Tie your Selection buttons to these bookmarks.

 

It's funny too, because I actually started writing that measure that you did and stopped because I knew it wouldn't work!! 🙂



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@Anonymous - Pretty sure the answer to this is still "no". 🙂

 

But maybe someone has a nifty way around it, I just can't think of a way.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Users online (1,978)