Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
So I have 4 buttons set up for page navigation within a report. 2 of the pages are Current Year Data and another is "Last Month". Instead of having Static text for the buttons as "Current Year" and "Last Month", I wanted the buttons to be dynamic with the text. I wrote the measures as:
Last Month Button Text =
Calculate(
Values('Date'[Month Name]),
'Date'[Month Offset] = -1
)
Current Year Button Text =
Calculate(
Values('Date'[Year]),
'Date'[Year Offset] = 0
)
The Last Month measure is not greyed out and works perfectly in the Button and shows November. The issue is the Current Year button as the measure is greyed out in the field value drop down. I have tried different measures for the current year, but all still have the measure greyed out and un-selectable. I have tried "Max" instead of "Values".
Does anyone know what could be causing this. I have made sure that the columns being filtered or used are in the correct format.
Hi @dbrandone, it appears from my testing that only Text columns/measures can be returned as button text. In your case, "Month Name" is a text value, while "Year" is likely numeric.
You could try either converting Year to Text, or wrapping your "Current Year Button Text" in a FORMAT function like below:
Current Year Button Text =
FORMAT (
CALCULATE ( VALUES ( 'Date'[Year] ), 'Date'[Year Offset] = 0 ),
"General Number"
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 34 | |
| 31 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 71 | |
| 37 | |
| 35 | |
| 25 |