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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Display exact value instead of first or last or Count

Data:

maheshchubb123_1-1600358268729.png

 

Requirement:

Group API wise and display total success and total failure percentage.

I created the required two measures as follows:

 

GlobalSuccessPercentage = IF(SUM(GlobalAPIMAPIsUsageDaily[callCountTotal]) == 0, "No Requests" , CONCATENATE(CONVERT
(ROUND(DIVIDE(SUM(GlobalAPIMAPIsUsageDaily[callCountSuccess]),SUM(GlobalAPIMAPIsUsageDaily[callCountTotal])) * 100, 2),STRING), "%"))

 

Sample output: 88%

 

GlobalFailurePercentage = IF((GlobalAPIMAPIsUsageDaily[callCountTotal]) == 0, "No Requests" , CONCATENATE(ROUND((DIVIDE(SUM(GlobalAPIMAPIsUsageDaily[callCountFailed])),SUM(GlobalAPIMAPIsUsageDaily[callCountTotal])))*100,2),"%"))

 

Sample output: 20%

 

But when i created a card and binded GlobalSuccessPercentage, it is showing below options instead of displaying calculated as it is.

so it either displays first or last or count. so irrespective of API i select it always diplays the same value. Same issue for GlobalFailurePercentage  as well.

 

Please let me know if iam missing anything here.

 

powerBi.png

 
 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@maheshchubb123 , Looking at the first measure seems like you are return text. For percent, you should return the number.

 

Also, seem like is a measure so already aggregated.

Create only this

DIVIDE(SUM(GlobalAPIMAPIsUsageDaily[callCountSuccess]),SUM(GlobalAPIMAPIsUsageDaily[callCountTotal]))

 

if you return "no request" it will become text. Then the formula is correct and should work.

 

In case you use the above formula then from the measure tool, mark it % and choose decimal

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Based on the data that you have shared, please show the exact result that you are expecting.  Also, share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@maheshchubb123 , Looking at the first measure seems like you are return text. For percent, you should return the number.

 

Also, seem like is a measure so already aggregated.

Create only this

DIVIDE(SUM(GlobalAPIMAPIsUsageDaily[callCountSuccess]),SUM(GlobalAPIMAPIsUsageDaily[callCountTotal]))

 

if you return "no request" it will become text. Then the formula is correct and should work.

 

In case you use the above formula then from the measure tool, mark it % and choose decimal

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.