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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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