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
gaznez
Helper I
Helper I

choose 2 months from slicer & have the column headers in matrix visual change to chosen months

I have a matrix visual showing costs for 2 specific months that are selected from a slicer.  The measures used to do this are called Month1 and Month2.  Is there a way I can get the column headers to change to the 2 specific months selected?

 

Matrix visual & slicer:

gaznez_0-1712915960709.png

So in the above Scenario - I would want Month1 to show as Mar24 and Month2 to show as Jan24

The DAX for Month1 = 

Month1 =
VAR MaxDate = MAX(Dates[MonthYear])
RETURN
CALCULATE([Cost],Dates[MonthYear] = MaxDate)
The DAX for Month 2 is the sam but uses MIN instead of MAX.
Any help would be greatly appreciated!
Thanks!

 

1 ACCEPTED SOLUTION
gaznez
Helper I
Helper I

Hi all,

I eventually found my own workaround.  I moved the Month1 and Month2 measures to 'Columns' in the matrix - rather than values (see image below)...

gaznez_0-1713169437176.png

This then meant that I had 'Cost' , 'Diff' and '%' showing under each of the 2 months.  I then had to hide the 'Diff' and '%' columns for every month that could be chosen in the slicer - since it is only the Total Diff & % that makes any sense.  Final result works...

gaznez_1-1713169758066.png

Thanks @Ritaf1983 for the suggestions, although I was unable to replicate any of those workarounds to my model.

View solution in original post

2 REPLIES 2
gaznez
Helper I
Helper I

Hi all,

I eventually found my own workaround.  I moved the Month1 and Month2 measures to 'Columns' in the matrix - rather than values (see image below)...

gaznez_0-1713169437176.png

This then meant that I had 'Cost' , 'Diff' and '%' showing under each of the 2 months.  I then had to hide the 'Diff' and '%' columns for every month that could be chosen in the slicer - since it is only the Total Diff & % that makes any sense.  Final result works...

gaznez_1-1713169758066.png

Thanks @Ritaf1983 for the suggestions, although I was unable to replicate any of those workarounds to my model.

Ritaf1983
Super User
Super User

Hi @gaznez 
We don't have this option as a core formatting.
But there are some workarounds to achieve it .
Please refer to the linked videos:

https://www.youtube.com/watch?v=zbKNyFu2BOo

https://www.youtube.com/watch?v=IM4DaT6oF6k

https://www.youtube.com/watch?v=4emPkBiiCtg

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

Helpful resources

Announcements
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.