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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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