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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
cghanta
Helper I
Helper I

Percentage from Text Columns

I have 2 questions.  I need to create 2 measures from text columns and display as cards ignoring the slicer.

I have a table UPS, it has a Location colum and Maintenance Bypass column (Text) & Dual UPS column (Text).

 

LocationMaintenance BypassDual UPS
city1Yesn/a
city3Yesn/a
city3YesYes
city4Non/a

 

Measure1 = percentage of locations that do not have Maintenance Bypass, ignoring the location slicer selection

Measure2 = percentage of locations that have Dual UPS, ignoring the location slicer selection.

Thnaks in Advance.

1 ACCEPTED SOLUTION
Akash_Varuna
Super User
Super User

Hi @cghanta Try these please 

Measure1 = 
VAR TotalLocations = COUNTROWS(ALL(UPS))
VAR NoMaintenanceBypass = COUNTROWS(
    FILTER(ALL(UPS), UPS[Maintenance Bypass] = "No")
)
RETURN
DIVIDE(NoMaintenanceBypass, TotalLocations, 0) * 100
Measure2 = 
VAR TotalLocations = COUNTROWS(ALL(UPS))
VAR WithDualUPS = COUNTROWS(
    FILTER(ALL(UPS), UPS[Dual UPS] = "Yes")
)
RETURN
DIVIDE(WithDualUPS, TotalLocations, 0) * 100

View solution in original post

5 REPLIES 5
patelsandeep239
New Member

Thanks for sharing

cghanta
Helper I
Helper I

Thank you.

Akash_Varuna
Super User
Super User

Hi @cghanta Try these please 

Measure1 = 
VAR TotalLocations = COUNTROWS(ALL(UPS))
VAR NoMaintenanceBypass = COUNTROWS(
    FILTER(ALL(UPS), UPS[Maintenance Bypass] = "No")
)
RETURN
DIVIDE(NoMaintenanceBypass, TotalLocations, 0) * 100
Measure2 = 
VAR TotalLocations = COUNTROWS(ALL(UPS))
VAR WithDualUPS = COUNTROWS(
    FILTER(ALL(UPS), UPS[Dual UPS] = "Yes")
)
RETURN
DIVIDE(WithDualUPS, TotalLocations, 0) * 100

Hi @Akash_Varuna

for the Measure2, the Maintenance Bypass value has changed from No to Yes for city4, and it is displaying (Blank) value, how can I display it as 0.00 instead.


for the Measure1, how can I exclude a location city1

thank you in advance

cghanta
Helper I
Helper I

the following mesaure works, 

%No Manit Bypass = DIVIDE( CALCULATE( COUNTROWS( UPS ), UPS[Maintenance Bypass] = "Yes" ), COUNTROWS( UPS ) )

how do I add filter to ignore the slicer?  The above is calculating per row, due to the slicer (giving  answer 1 for teh 1st 3 cities), I want it to calculate % for all rows ignoring the slicer (the answer should be 1/4 = .25) and display 25%

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.