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 am trying to create a measure to show the updated date in my report. At first, my measure is MTD_DATE = "MTD Through " & FORMAT(TODAY()-1, "DDDDDD"). But my report is to be refreshed around 10am daily so it might cause confusion if someone takes a look of my report before daily refresh. So I decided to create a SQL table (DTR_mtd_date) with MTD date in text format and import it to Power BI. See screenshot below.
My 2nd measure is MTD_Date2 = "MTD Through" & MIN(DTR_mtd_date[mtd_date]). However, when it is added into Text Box, there aer some extra spaces after "MTD Through" as shown below. There are no such extra spaces when it is shown in table visaul. What's wrong with it and how to fix it? Let me know if you need my pbix file for investigation.
Thanks.
Solved! Go to Solution.
After playaround with DAX text functions, here is my solution: MTD_Date2 = "MTD Through " & TRIM(MIN(DTR_mtd_date[mtd_date])). The extra spaces are trimmed as shown below:
After playaround with DAX text functions, here is my solution: MTD_Date2 = "MTD Through " & TRIM(MIN(DTR_mtd_date[mtd_date])). The extra spaces are trimmed as shown below:
Another option is to put my MTD_Date2 measure into card visual. It also has extra spaces with source spacing enabled. Fortunately, the extra spaces is removed with source spacing disabled. However, text in card visaul is always center aligned. How may I left align text in card visual?
Sorry, I just remembered that card visual has a bug that this measure can't be displayed correctly in Power BI Mobile. So card visual is not an option.
@bergen288 , Please use the format in the measure too. Auto conversion of date to text might have added that space
MTD_Date2 = "MTD Through" & FORMAT(MIN(DTR_mtd_date[mtd_date]),"DDDDDD")
I have updated: MTD_Date2 = "MTD Through" & FORMAT(MIN(DTR_mtd_date[mtd_date]),"DDDDDD"). But it still has extra spaces after "MTD Through".
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 |