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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Stuznet
Helper V
Helper V

Round Millions to more readable digits and Display as $ currency

Hi guys,

 

I'm having problem rounding numbers to more readable digits and struggle with the formatting.

 

Here is the original function before I tried to round it 

 

Measure = SWITCH(TRUE(),
    
MAX(Table2[Category]) = "Value",
CALCULATE(SUM(Table1[Amount]),
FILTER(Table1,SEARCH("(25%) - (10%)",[Percent],1,0))))

 

Here is my function that I modified but I received an error 

The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

 

Measure = SWITCH(TRUE(),
    
MAX(Table2[Category]) = "Value",
ROUND(CALCULATE(SUM(Table1[Amount]) / 1000),
FILTER(Table1,SEARCH("25% - 10%",[Percent],1,0) )))

I would like it to display $747 with the currency sign (Is there a function I can write to display the currency beside using the Modeling ribbon?)  and I would like the numbers display in the Table visualization and not in the Card visualization.

 

 

2018-10-02_9-54-37.png

 

Thank you all 🙂

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

I must say I don't really get what you're trying to achieve, so not sure how to help you

 

in general you can use format in the following way:

Formatted Measure = FORMAT ( [Measure], "$#,##0" )


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

4 REPLIES 4
Stachu
Community Champion
Community Champion

you can use FORMAT to do that

https://msdn.microsoft.com/en-gb/query-bi/dax/format-function-dax



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

@StachuI tried to used that function but I don't know how to make it to work.

Stachu
Community Champion
Community Champion

I must say I don't really get what you're trying to achieve, so not sure how to help you

 

in general you can use format in the following way:

Formatted Measure = FORMAT ( [Measure], "$#,##0" )


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Thank you for the tips.

 

This is how I wrote my measure

Measure = SWITCH(TRUE(),
    
MAX(Table1[ID]) = "ABC",
    FORMAT([Count of ID],"#,##0")

MAX(Table1[Account]) = "ACC",
    FORMAT([Count of Account],"$#,,"))

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.