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
IvanS
Helper V
Helper V

Dynamic date measure as button text

Hello,

I am trying to replace buttons with static text "Current Month" & "Previous Month" to the dynamic text with the name of month & year. I have created 2 measures that are giving me the desired value on card visual. Formulas below:

CurrentMonth_TextDate = 
    FORMAT(DATE(YEAR(NOW()), MONTH(NOW()), 1) , "mmmm yyyy")
PreviousMonth_TextDate = 
 IF(MONTH(TODAY()) = 1, 
    FORMAT(DATE(YEAR(NOW())-1, MONTH(NOW())-1, 1), "mmmm yyyy"),
        FORMAT(DATE(YEAR(NOW()), MONTH(NOW())-1, 1), "mmmm yyyy")
        )

The issue is that the measures are greyed out when trying to add them to the conditional formatting of button. See image below.

IvanS_0-1655735240237.png

Any suggestions?


Thank you

IvanS

 

 

1 ACCEPTED SOLUTION
Hariharan_R
Solution Sage
Solution Sage

Hi @IvanS 

It is working fine for the same measures. Ensure you have the Text data type for the measures.

Hariharan_R_0-1655735568090.png

 

Thanks

Hari

Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


My Blog :: YouTube Channel :: My Linkedin


View solution in original post

2 REPLIES 2
Hariharan_R
Solution Sage
Solution Sage

Hi @IvanS 

It is working fine for the same measures. Ensure you have the Text data type for the measures.

Hariharan_R_0-1655735568090.png

 

Thanks

Hari

Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


My Blog :: YouTube Channel :: My Linkedin


Huge thanks for quick response 🙂 issue was in formatting 🙂

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors