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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

dynamically change the name of a label in a column.

Here's teh pbix file https://1drv.ms/u/s!Amd7BXzYs7AVlm0j7IBWB7EZWKIM?e=LTrZMe

I use field parameter 

Slice by = {
    ("Brand", NAMEOF('Product'[Brand]), 0),
    ("Category", NAMEOF('Product'[Category]), 1),
    ("Color", NAMEOF('Product'[Color]), 2),
    ("Continent", NAMEOF('Customer'[Continent]), 3),
    ("Country", NAMEOF('Customer'[Country]), 4)
}
 
jawaher89_6-1671096536708.png

 

I add a slicer Month-year 

 
jawaher89_5-1671096515136.png

 

I'd like when I select for the slicer monthyear for example feb 2020, I'd like that in the matrix Brand and category will be renamed as Brand feb 2020 and category feb 2020, is there a way to do it please?

 
jawaher89_4-1671096501829.png

 

 

1 ACCEPTED SOLUTION

Hi, @Anonymous, 

doable, but not pretty:

First you need to create a table with all the possible combinations of header values. Then add these header values on the column of your matrix. This table should not have relationships to any other tables.

 

Then create a measure something like this:

Sales = var _month = CALCULATE(SELECTEDVALUE('Table'[Month]))
var _header = CALCULATE(SELECTEDVALUE(Headers[Header]))
var _sales = CALCULATE(SUM('Table'[Sales]),FILTER('Table',CONTAINSSTRING(_header,'Table'[Brand]) && CONTAINSSTRING(_header,_month)))
return
_sales

 

I tried to get the file from the link you provided, but there were some logins I was not quite comfortable with providing.

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

View solution in original post

2 REPLIES 2
TotunG
Resolver I
Resolver I

Not sure how to do it, would need like a concatenate function for a column header but not sure thats possible(?). Really basic idea but maybe could have a callout card above them to highlight the fact it is Feb 2020 for example?

Hi, @Anonymous, 

doable, but not pretty:

First you need to create a table with all the possible combinations of header values. Then add these header values on the column of your matrix. This table should not have relationships to any other tables.

 

Then create a measure something like this:

Sales = var _month = CALCULATE(SELECTEDVALUE('Table'[Month]))
var _header = CALCULATE(SELECTEDVALUE(Headers[Header]))
var _sales = CALCULATE(SUM('Table'[Sales]),FILTER('Table',CONTAINSSTRING(_header,'Table'[Brand]) && CONTAINSSTRING(_header,_month)))
return
_sales

 

I tried to get the file from the link you provided, but there were some logins I was not quite comfortable with providing.

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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