Forum Discussion

mattapq's avatar
mattapq
Regular Visitor
6 years ago
Solved

Custom Visual - Accepting the Data Modelling Date Format

In the Desktop version of Power BI, you can select a Date field and in the ribbon you can change the Modelling > Format of the date.     In the default Power BI line chart, this changes the ...
  • dm-p's avatar
    dm-p
    6 years ago

    Hi mattapq - fundamentally, you just need to install powerbi-visuals-utils-formattingutils to your project and using valueFormatter but it's also going to depend on you've chosen to implement your code. For instance, if you're using v3 of the visuals SDK vs. 1/2, or whether you're using D3 to do your chart, or something else.

    D3 v3 (which is supported by the older SDKs) can handle the format strings as standard but some stuff changed in v4/5 and the v3 SKD recommends that version. The implementation of axis tick formatting is a little different for those, so I just want to make sure I provide you with more targeted advice, if possible. I can definitely help with D3 but if it's something else I might need to do a bit of digging.

    If you're able to share anything code-wise, I can take a look for you and provide something that will hopefully get you on the path to your desired solution.

    Cheers,

    Daniel