Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm trying to create a measure (label) that will display an header ex: Summary of Results - April 2020
I'm using this dax formula but the date is not appearing and it is looking like this.. Summary of Results -
To give some contexts, the date is stored in a column Transaction Results Period
Transaction Results Period
January 2020
February 2020
March 2020
April 2020
June 2020
...
Here is the measure I'm using..
Label =
VAR zDate = SELECTEDVALUE('Transaction Results Period'[Results Period])
RETURN
"Summary of Results - " & FORMAT(zDate, "mmm yyyy")
What am I doing wrong? I've tried so many variations such as using _selectedYear instead of zDate and getting the same results ... the date is missing.
Solved! Go to Solution.
@Anonymous , is "Results Period" is a date, if not this will not work as the format of date has been used.
Also if its date try
Label =
VAR zDate = max('Transaction Results Period'[Results Period])
RETURN
"Summary of Results - " & FORMAT(zDate, "mmm yyyy")
Hi @Anonymous ,
I just tried your measure, it works well. Could you please provide the related screen shot about the data and visual/slicer setting in Power BI Desktop? Which data type the field Results Period is?
Best Regards
Rena
Hi @Anonymous ,
I just tried your measure, it works well. Could you please provide the related screen shot about the data and visual/slicer setting in Power BI Desktop? Which data type the field Results Period is?
Best Regards
Rena
@Anonymous , is "Results Period" is a date, if not this will not work as the format of date has been used.
Also if its date try
Label =
VAR zDate = max('Transaction Results Period'[Results Period])
RETURN
"Summary of Results - " & FORMAT(zDate, "mmm yyyy")
@amitchandak- confirming that your solution worked once as I created the Results Period in a DIM. It was previously in a big table which I had imported. That's the only change that I made so that your solution reflects the current month. My query still does not work.
@amitchandak,your suggestion worked perfectly.
I still don't understand why what I was using wouldn't work. As shown in the screenshots, the Result Period is in a date format, as shown in the following screenshot.
I will use your suggested solution above as it works. Thank you so much for your help!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |