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
Invesco
Helper V
Helper V

Measure Filtering issue

Hi Experts

 

Based on the sample data below. 

crm_call_nameDateday_name_shortweek_start_dateweek_end_datemonth_desc_shortactivity_type_1product_name_data_value
C02744964223-Nov-22Wed21-Nov-2227-Nov-22Novf2fApples1
C02744964423-Nov-22Wed21-Nov-2227-Nov-22Novf2fApples1
C02744974423-Nov-22Wed21-Nov-2227-Nov-22Novf2fApples1
C02747542223-Nov-22Wed21-Nov-2227-Nov-22Novf2fApples1
C02744964523-Nov-22Wed21-Nov-2227-Nov-22Novf2fApples1
C02747542323-Nov-22Wed21-Nov-2227-Nov-22Novf2fApples1
C02744964123-Nov-22Wed21-Nov-2227-Nov-22Novf2fApples1
C02744964023-Nov-22Wed21-Nov-2227-Nov-22Novf2fApples1
C02744974123-Nov-22Wed21-Nov-2227-Nov-22Novf2fApples1
C02744964623-Nov-22Wed21-Nov-2227-Nov-22Novf2fTrelegy1
C02747544324-Nov-22Thu21-Nov-2227-Nov-22Novf2fOranges1
C02744975124-Nov-22Thu21-Nov-2227-Nov-22Novf2fOranges1
 21-Nov-22Mon21-Nov-2227-Nov-22Novcustomer_facing_day 1
 23-Nov-22Wed21-Nov-2227-Nov-22Novcustomer_facing_day 1
 25-Nov-22Fri21-Nov-2227-Nov-22Novcustomer_facing_day 1
 22-Nov-22Tue21-Nov-2227-Nov-22Novcustomer_facing_day 1
 24-Nov-22Thu21-Nov-2227-Nov-22Novcustomer_facing_day 1
         

 

1. John has 5 cutsomer facing days 

Measure

Days # =
    CALCULATE(SUM(act_rates_activity_volume_and_cf_days[data_value]),
            act_rates_activity_volume_and_cf_days[activity_type_1] = "customer_facing_day")+0
 
2. John see 12 customer f2f so 12/5 = 2.4 as his customer rate
 
Second measure
f2f Customers = Calculate(DISTINCTCOUNT('act_rates_activity_volume_and_cf_days'[crm_call_name]),
                            FILTER(VALUES(act_rates_activity_volume_and_cf_days),
                            not(act_rates_activity_volume_and_cf_days[activity_type_2] IN {"customer_facing_day","item_or_sample_drop","blank_call_type","Outlook_email"})))
 
Third Measure 
 
Weekly Rates =
Var Day_Count= [Days #]
Var Activity_CT= [ActivityCountTest]

Return
    Divide(Activity_CT,Day_Count,0)
 
Works at higher level...
 
When i try and filter down to product level - ie oranges  - so in our sample data john sold oranges to 2 customers - so based on customer facing days - johns rate shoud be 2/5 =0.4.....


i cannot get that using my measure - i get back 0.....not sure what the lower level filtering issue is
 
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Invesco ;

You could try this measure.

Weekly Rates = 
Var Day_Count= CALCULATE(SUM(act_rates_activity_volume_and_cf_days[data_value]),FILTER(ALL(act_rates_activity_volume_and_cf_days),
            act_rates_activity_volume_and_cf_days[activity_type_1] = "customer_facing_day"))
Var Activity_CT= CALCULATE(SUM(act_rates_activity_volume_and_cf_days[data_value]),
            act_rates_activity_volume_and_cf_days[activity_type_1] = "f2f")
Return
    Divide(Activity_CT,Day_Count,0)

The final show:

vyalanwumsft_0-1669949672756.pngvyalanwumsft_1-1669949678640.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Invesco ;

You could try this measure.

Weekly Rates = 
Var Day_Count= CALCULATE(SUM(act_rates_activity_volume_and_cf_days[data_value]),FILTER(ALL(act_rates_activity_volume_and_cf_days),
            act_rates_activity_volume_and_cf_days[activity_type_1] = "customer_facing_day"))
Var Activity_CT= CALCULATE(SUM(act_rates_activity_volume_and_cf_days[data_value]),
            act_rates_activity_volume_and_cf_days[activity_type_1] = "f2f")
Return
    Divide(Activity_CT,Day_Count,0)

The final show:

vyalanwumsft_0-1669949672756.pngvyalanwumsft_1-1669949678640.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Invesco
Helper V
Helper V

The issue is when i filter by Product_name and any other column to get lower level result - it set the customer facing days value to zero....

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.

Top Solution Authors