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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join 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 is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.