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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Pallavi_m
Helper I
Helper I

Dynamic measure based on selection slicer

hi,

I would need to create a dynamic title/measure.

The slicer selection is on monthyear column.

 

 If Dec2021, is selected, the title is Dec2021.

If Feb2022 is selected, the title is Feb2022 and etc...

 

Help is appreciated

 

 

 

idindexyearmonthmonthyear
20221120221

Dec 2021

20222220222Jan 2022
20223320223Feb 2022
20224420224Mar 2022
20225520225Apr 2022
20226620226May 2022
20227720227Jun 2022
20228820228Jul 2022
20229920229Aug 2022
20221010202210Sep 2022
20221111202211Oct 2022
20221212202212Nov 2022
202311320231Dec 2022
202321420232Jan 2023

 

1 ACCEPTED SOLUTION

Hi , @Pallavi_m 

According to your description, you want to "if jan 2022 is selected in the slicer, then measure has to return jan2022."

Here are the steps you can refer to :

(1)We can create a measure:

Measure = var _slicer_date=SELECTEDVALUE('Table'[monthyear])
return
FORMAT(_slicer_date,"mmm yyyy")

(3)Then we put the [monthyear] on the slicer visual and the measure on the card visual and we will meet your need :

vyueyunzhmsft_0-1668741370255.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

3 REPLIES 3
amitchandak
Super User
Super User

@Pallavi_m , You can use Matrix and use Month Year on the column.

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-matrix-visual

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak . Thanks for the quick reply.Could you eloborate more.

Requirement: measure has to be created on the slicer selection.

Measure returns just the monthyear column value i.e., if jan 2022 is selected in the slicer, then measure has to return jan2022.

Hope I'm clear.

Hi , @Pallavi_m 

According to your description, you want to "if jan 2022 is selected in the slicer, then measure has to return jan2022."

Here are the steps you can refer to :

(1)We can create a measure:

Measure = var _slicer_date=SELECTEDVALUE('Table'[monthyear])
return
FORMAT(_slicer_date,"mmm yyyy")

(3)Then we put the [monthyear] on the slicer visual and the measure on the card visual and we will meet your need :

vyueyunzhmsft_0-1668741370255.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 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.

Top Solution Authors