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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
fatimaarshd
Helper I
Helper I

How to format the results to percent

I want to be able to return actual number and the percentage of it. I am following this tutorial https://bielite.com/blog/calculating-percent-of-subtotal/

This helps include percentages to decomposition tree. However, the problem is that when the last condition is true I want to return the actual number and percentage of subtotal. For instance like this: 1200, 22%. But when IF is true it returns nothing. 

Patients =
VAR CurrentInitiated = VALUES(PROMSs[IsInitiated])
VAR CurrentCompleted = VALUES(PROMSs[IsCompleted])
VAR CurrentScore = VALUES('Score Order'[Final Score])
VAR CurrentIsLoggedIn = VALUES(PROMSs[IsLoggedIn])

VAR RevenueForCurrentSelection = SUM(PROMSs[AllPatients])
VAR InvitedPatients = VALUES(PROMSs[INVITED])

VAR TotalRevenue =
SWITCH(
TRUE(),------ logic here

IF(
ISINSCOPE(PROMSs[Invited]), FORMAT(12, "0.00%"),
--CONCATENATE(CONCATENATE(FORMAT(DIVIDE(RevenueForCurrentSelection, TotalRevenue), "0.00%"), " "), ------RevenueForCurrentSelection),
RevenueForCurrentSelection
)

 

What could be wrong here? I used constant value of 12 here to test but even 12 is not returning.

4 REPLIES 4
Anonymous
Not applicable

Hi @fatimaarshd ,

 

As far as I know, FORMAT() function will return text date type result. I think you just need to calcualte the number data type result by your measure and change the foramt as % in measure tool.

My Sample:

vrzhoumsft_0-1697528115484.png

My Measure:

Revenue % = 

VAR CurrentRetailerType = VALUES(Sales[Retailer type])

VAR CurrentProductLine = VALUES(Sales[Product line])

VAR RevenueForCurrentSelection = SUM(Sales[Revenue])

VAR TotalRevenue =

SWITCH(

    TRUE(),

    ISINSCOPE(Sales[Product line]),CALCULATE(SUM(Sales[Revenue]),ALLSELECTED(Sales),Sales[Retailer type] IN CurrentRetailerType),

    ISINSCOPE(Sales[Retailer type]),CALCULATE(SUM(Sales[Revenue]),ALLSELECTED(Sales))

)

RETURN

IF(

    ISINSCOPE(Sales[Retailer type]),

    DIVIDE(RevenueForCurrentSelection,TotalRevenue),

    1

)

Result is as below.

vrzhoumsft_1-1697528176939.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

For the first node I need to show  absolute value. 

 

fatimaarshd
Helper I
Helper I

I am using it in decomposition tree. I cant add another node for this

 

amitchandak
Super User
Super User

@fatimaarshd , I would simply create a measure without format function a numeric value

 

and then use % in meausre tool create  % column

 

Or you can choose the format from the measure tool

 

Data Format New Rib.png

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.