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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to Create a Measure.

Hi All,

can any one please help me with the calculation for below condition.

Max of [TAT] at Opportunity ID
Sum of [TAT]
where Snap_Flag = Opportunity_Snap, [TAT] => 0
/
Unique count of Opportunity ID
where shot_Flag = Opportunity_Snap, [TAT] => 0

Thanks and Regards,

Harish




1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Please try:

Measure = 
VAR SUM_ = CALCULATE(SUM('Table'[TAT]),FILTER('Table','Table'[Snap_Flag]="Opportunity_Snap"&&'Table'[TAT]>=0))
VAR UNIQUE_ = CALCULATE(DISTINCTCOUNT('Table'[Opportunity ID]),FILTER('Table','Table'[Snap_Flag]="Opportunity_Snap"&&'Table'[TAT]>=0))
RETURN DIVIDE(SUM_,UNIQUE_)

If the problem persists, please provide your sample data and expected results.

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-... 

View solution in original post

1 REPLY 1
V-lianl-msft
Community Support
Community Support

Please try:

Measure = 
VAR SUM_ = CALCULATE(SUM('Table'[TAT]),FILTER('Table','Table'[Snap_Flag]="Opportunity_Snap"&&'Table'[TAT]>=0))
VAR UNIQUE_ = CALCULATE(DISTINCTCOUNT('Table'[Opportunity ID]),FILTER('Table','Table'[Snap_Flag]="Opportunity_Snap"&&'Table'[TAT]>=0))
RETURN DIVIDE(SUM_,UNIQUE_)

If the problem persists, please provide your sample data and expected results.

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-... 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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 Kudoed Authors