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
fyk_cz
Regular Visitor

Measure for percentage of selected carriers

Situation: I have data of delivery. Data includes: carrier, delivery date, state. I need to find out the percentage assessment of the number of shipments per carrier in the given period. Use "Show value> Percent of grand total" to show percentages per carrier. But if I use a filter for two carriers, it still shows me percentages across all carriers. But I need percentages in selected carriers. I can not write a measure that would only calculate percentages for selected carriers. Can anyone help me?

2 REPLIES 2
nickchobotar
Skilled Sharer
Skilled Sharer

@fyk_cz 

 

Here is another option. Use table or matrix visual and place your carriers as row headers and the measure below on value

 

Shipment Ratio =
VAR Shipments =
    SUM ( Carriers[Shipments] )
RETURN
DIVIDE ( 
Shipments,
CALCULATE (
Shipments,
ALLSELECTED ()
)
)

 

 

 

v-huizhn-msft
Employee
Employee

Hi @fyk_cz,

You said you use a filter for two carriers, what filters do you use? You use a slicer, visual level filter or page level filter? If you use a slicer, please create a measure using the formula below and check if it works fine.

Percentage=DIVIDE(CALCULATE(COUNT(Table[carrier]),ALLSELECTED(Table)),COUNTX(ALL(Table),Table[carrier]))


Please respond to me if you have any other issues.

Best Regards,
Angelia

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.