March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi there
I want to create a measure that calculates a percentage and includes text. I have created the below code but the percentage appears as 3.5715518772422e-02.
When I isolate the percentage calculation without the text, it appears correctly as 3.57%
Is there anything I can do to display the percentage correctly?
Measure = "Map represents "& DIVIDE( CALCULATE( COUNTROWS(Dataset'), FILTER('Dataset','Dataset'[Country of Residence]<>"")), COUNTROWS('Dataset')) &"% of Live users"
Thanks,
Jemma
Solved! Go to Solution.
Hey,
for similar requirements I use FORMAT to shape the value to my accordance like so
_test measure = var selectedrows = COUNTROWS('Fact Sale open') var allrows = CALCULATE(COUNTROWS('Fact Sale open') , ALL('Dimension City'[Sales Territory])) return "the share of the selected territories is " & FORMAT(DIVIDE(selectedrows , allrows , BLANK()) * 100 , "#.000000") & "%"
This looks on a Card visual like this:
Hopefully this is something you are looking for.
Regards,
Tom
Hey,
for similar requirements I use FORMAT to shape the value to my accordance like so
_test measure = var selectedrows = COUNTROWS('Fact Sale open') var allrows = CALCULATE(COUNTROWS('Fact Sale open') , ALL('Dimension City'[Sales Territory])) return "the share of the selected territories is " & FORMAT(DIVIDE(selectedrows , allrows , BLANK()) * 100 , "#.000000") & "%"
This looks on a Card visual like this:
Hopefully this is something you are looking for.
Regards,
Tom
Perfect @TomMartens I changed your measure to the below and I get 3.5% which is perfect.
Country of Residence % = "Map represents "&FORMAT(DIVIDE( CALCULATE( COUNTROWS('Dataset'), FILTER('Dataset','Dataset'[Country of Residence]<>"")), COUNTROWS('Dataset'))*100,"#0.0")&" % of Live users"
Perfect @TomMartens I changed your measure to the below and I get 3.5% which is perfect.
Country of Residence % = "Map represents "&FORMAT(DIVIDE( CALCULATE( COUNTROWS('Dataset'), FILTER('Dataset','Dataset'[Country of Residence]<>"")), COUNTROWS('Dataset'))*100,"#0.0")&" % of Live users"
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
90 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |