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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Analitika
Post Prodigy
Post Prodigy

Change column name if filter is changed value in Power BI

Hello,

 

I would like to ask how to make that if user selects filter value, then changes visual table column name. For example, filter contains price/unit selection, if user selects filter value price, then visual column name is price, if selects unit, then colum name is unit? How to achieve this in Power BI?

1 ACCEPTED SOLUTION
isabella
Employee
Employee

Hi @Analitika 

I did a local test,hope it will help you.

Here is my test table

isabella_0-1653034341723.png

 

 

Then I create 2 measures

saleprice measure = SUM([salesprice])

salevolumn measure = SUM([salesvolumn])

 

 

then I create a table for choose the measure

isabella_1-1653034341724.png

 

Create a slicer

isabella_2-1653034341725.png

 

 

Then I create the most important measure ,use this measure you can change the value  by slicer

Measure 2 = SWITCH(TRUE(),SELECTEDVALUE('slicer for measure type'[type],"no option")="price",[saleprice measure],SELECTEDVALUE('slicer for measure type'[type],"no option")="volumn",[salevolumn measure],[saleprice measure])

 

When I select the price on the slicer ,this measure will show [saleprice measure],when I select volumn it will show [saleprice measure]and when no one selectedI will let it show [saleprice measure]

isabella_3-1653034341726.png

 

 

 

 

isabella_4-1653034341727.png

 

Best Regards,

Community Support Team _Isabella

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

View solution in original post

2 REPLIES 2
isabella
Employee
Employee

Hi @Analitika 

I did a local test,hope it will help you.

Here is my test table

isabella_0-1653034341723.png

 

 

Then I create 2 measures

saleprice measure = SUM([salesprice])

salevolumn measure = SUM([salesvolumn])

 

 

then I create a table for choose the measure

isabella_1-1653034341724.png

 

Create a slicer

isabella_2-1653034341725.png

 

 

Then I create the most important measure ,use this measure you can change the value  by slicer

Measure 2 = SWITCH(TRUE(),SELECTEDVALUE('slicer for measure type'[type],"no option")="price",[saleprice measure],SELECTEDVALUE('slicer for measure type'[type],"no option")="volumn",[salevolumn measure],[saleprice measure])

 

When I select the price on the slicer ,this measure will show [saleprice measure],when I select volumn it will show [saleprice measure]and when no one selectedI will let it show [saleprice measure]

isabella_3-1653034341726.png

 

 

 

 

isabella_4-1653034341727.png

 

Best Regards,

Community Support Team _Isabella

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

Arul
Super User
Super User

@Analitika ,

Please check this thread if it is solves your problem or not.

https://community.powerbi.com/t5/Desktop/Create-table-from-measure-for-visual/m-p/2501880#M889608 

Thanks,

Arul





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

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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