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

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.

Reply
Anonymous
Not applicable

Calculating Text Field with Date Filter

Hello,


I wanted to format my date in a different way, so I created a Calculated Column using DAX to have it as "mm/dd/yyyy ddd". However, when I put [Date of Incident NewNew] inside a Card Visual, for the "Last Date", it does not return me with the latest date. How do I create a measure, where the [Date of Incident NewNew] is returned, with the latest [Date of Incident]. Will appreciate any help!

 dateofincident.PNGdateofincidentcard.PNGdateofincidentcarddetails.PNG

You can see here that the latest date is 09/22/2018, not 12/21/2017

 

 

Much appreciated!!

Vivian

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

    Because the data type of field Date of Incident NewNew is Text. so the last value is sort by text not by date.

You can add a measure to achieve it.

Measure 3 = CALCULATE(VALUES(Table2[Date of Incident NewNew]),FILTER(Table2,MAX(Table2[Date])=Table2[Date]))

Result:

5.PNG

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Chihiro
Solution Sage
Solution Sage

Instead of creating Text column.

 

Click on the Column or measure highlight it.

 

Then go to Modeling tab. Formatting section, click on Format: drop down.

 

Find the format of your choice (MM/dd/yyyy)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.