Rolf_Vermeer's avatar
Rolf_Vermeer
New Member
1 year ago
Status:
New

Dynamic formatting of date measure

Dynamic formatting of measures that return a date is not possible.

When creating a measure that returns a date, it is not possible to enable the dynamic format, while there are several use-cases where this would be relevant.

 

Then, I tricked PowerBi into enabling dynamic formatting by first creating a numerical measure then setting formatting to dynamic and setting the format string, and then changing the measure to the actual measure, it results in weird behaviour:

Format string:

 

Result, showing "Oc" instead of "Oct":

However, if I keep the date to a numeric value (so measure: "TEST = 1* MIN(SalesOrders[ShipmentDate])", the behaviour is even more unexpected, the same dates as above then result in this:

 

So clearly, dynamic formatting in such cases does not work as expected while it would solve several issues.

 

(Note: I'm aware that this example could be achieved in much easier ways, but the actual use-case is more complex, but not so relevant for this idea)

2 Comments

  • I need dynamic Format for this: 

    Last Modified WHSWorkLine CLT =
    -- EN: CLT = Company Local Time, UTC, if ambigious
    TimeZone.ConvertUtcToLocal (
        [Last Modified WHSWorkLine UTC],
        SELECTEDVALUE ( 'Company'[TimeZone] )
    )



    I have same Issue and I would like to have it. 

    In my case the desired result world be 

    Last Modified WHSWorkLine Fmt =
    FORMAT ( [Last Modified WHSWorkLine CLT], "General Date" )   & " "  & SELECTEDVALUE ( Company[TZ], "UTC" )


    Another display Measure works, but i'd prefer dynamic formatting. 

  • PS: The Workaround with Fmt has also the disadvantage that it uses the system culture and not the User Culture! There is also a workaround possible with UserCulture for that but this makes code maybe a bit heavy. 


Recent ideas