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
Georgia_H
Helper I
Helper I

How to set the denominator to be used as a constant value for calculation

Hello,

Can anyone please help. Thank you.

 

Objective: I want to calculate the Avg Compliance % of Metrics_ID divided by the constant Denominator (unique count by LBU & Metrics_ID i.e. 12)

Issue: I am unable to get the denominator as 12 to be applied in my division.

 

2 Measures derived:

I derived this measure to get the Distinctcount of Metrics_ID in the dataset (used as denominator)

Denominator =

VAR Count_PCM_denominator=CALCULATE(DISTINCTCOUNT('rep F_ITS_MetricsLanding'[Metrics_ID]),FILTER('rep F_ITS_MetricsLanding','rep F_ITS_MetricsLanding'[Metrics_ID] in {"PCM01","PCM03","PCM04","PCM09","PCM10","PCM19","PCM20","PCM23","PCM33","PCM34","PCM35","PCM36"}),ALL('rep F_ITS_MetricsLanding'[Metrics_ID],'rep F_ITS_MetricsLanding'[LBU]))

RETURN Count_PCM_denominator

 

Compliance_Value (AVG) =
VAR numerator=CALCULATE(AVERAGE('rep F_ITS_MetricsLanding'[Compliance_Value]))
RETURN DIVIDE(numerator,'rep F_ITS_MetricsLanding'[Denominator])
 

Expected Results:

Expected Results for EILUX  
LBUMetrics_IDAvg Compliance %Denominator (unique by Metrics_ID)Expected Compliance_Value (AVG) divided by MAX Count of Denominator i.e. 12
EILUXPCM2360.10%125.00%
    5.00%

 

Expected Results for PCALKK  
LBUMetrics_IDAvg Compliance %Denominator (unique by Metrics_ID)Expected Compliance_Value (AVG) divided by MAX Count of Denominator i.e. 12
PCALKKPCM04100.00%128.33%
    8.33%

 

Expected Results for PAMC  
LBUMetrics_IDAvg Compliance %Denominator (unique by Metrics_ID)Expected Compliance_Value (AVG) divided by MAX Count of Denominator i.e. 12
PAMCPCM0178.80%126.57%
PAMCPCM0381.30%126.78%
PAMCPCM0462.10%125.18%
PAMCPCM0956.80%124.73%
PAMCPCM1059.60%124.97%
PAMCPCM1968.60%125.72%
PAMCPCM2055.90%124.66%
PAMCPCM2385.90%127.16%
PAMCPCM3365.00%125.42%
PAMCPCM3447.80%123.98%
PAMCPCM3557.10%124.76%
PAMCPCM3662.00%125.17%
    65.08%

 

Sample data:

LBUMetrics_IDAvg Compliance %Denominator (unique by Metrics_ID)
EILUXPCM2360.10%1
PAMCPCM0178.80%1
PAMCPCM0381.30%1
PAMCPCM0462.10%1
PAMCPCM0956.80%1
PAMCPCM1059.60%1
PAMCPCM1968.60%1
PAMCPCM2055.90%1
PAMCPCM2385.90%1
PAMCPCM3365.00%1
PAMCPCM3447.80%1
PAMCPCM3557.10%1
PAMCPCM3662.00%1
PCALKKPCM04100.00%1
   12
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Georgia_H 

Thanks for reaching out to us.

You can try this measure,

Denominator = 

VAR Count_PCM_denominator=CALCULATE(DISTINCTCOUNT('rep F_ITS_MetricsLanding'[Metrics_ID]),FILTER(ALL('rep F_ITS_MetricsLanding'),'rep F_ITS_MetricsLanding'[Metrics_ID] in {"PCM01","PCM03","PCM04","PCM09","PCM10","PCM19","PCM20","PCM23","PCM33","PCM34","PCM35","PCM36"}))

RETURN Count_PCM_denominator

vxiaotang_0-1660721194273.png

 

 

Best Regards,

Community Support Team _Tang

If this post helps, 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-xiaotang
Community Support
Community Support

Hi @Georgia_H 

Thanks for reaching out to us.

You can try this measure,

Denominator = 

VAR Count_PCM_denominator=CALCULATE(DISTINCTCOUNT('rep F_ITS_MetricsLanding'[Metrics_ID]),FILTER(ALL('rep F_ITS_MetricsLanding'),'rep F_ITS_MetricsLanding'[Metrics_ID] in {"PCM01","PCM03","PCM04","PCM09","PCM10","PCM19","PCM20","PCM23","PCM33","PCM34","PCM35","PCM36"}))

RETURN Count_PCM_denominator

vxiaotang_0-1660721194273.png

 

 

Best Regards,

Community Support Team _Tang

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

lbendlin
Super User
Super User

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.