Showing results for 
Search instead for 
Did you mean: 
Advocate III
Advocate III

DAX FORMAT() eating all my capacity memory



I have a measure I'm using to switch between various measures for a matrix, using a drop down slicer



Selected KPI = 
        FIRSTNONBLANK('Dim Selected Measure'[Selected_Measure], 1),
            "Number of Sales", [Number of Sales],
            "Number of Products", [Number of Products],
            "Cost", FORMAT([Cost],"£#,##0")



The last measure I want to format as a currency, so have used the FORMAT() function.


This works well for small datasets but as my data is rather big it runs out of memory. Is there a way for format the measure dynamically using another method? The Cost measure itself is formatted as a currency but the formatting gets lost when used as part of another measure.


The first two measures in the list work perfectly, so it is definitly the FORMAT() function eating all the memory in my Power BI capacity.


Any help or advice appreciated.

Many Thanks

Community Support
Community Support

Hi @dom99 ,


I am afraid that Power BI doesn't support it currently. You could vote for these ideas to improve Power BI and make the feature coming sooner.


Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Super User IV
Super User IV

@dom99 , as of now dynamic formatting of measure if not available.


Try the code in this -


Avoid first non blank and see

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources


Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors