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
eloomis
Advocate II
Advocate II

Callout min and max of an averagex measure

I have a measure which calculates the average difference in a projects promise date and actual completion date. The goal is to have a card visual in my report that calls out the project type that has the highest average and the project with the lowest average.

 

With my current measure I can put it in a table with project type to get the average for all project types, and do some conditional formatting to highlight the highest and lowest, but I would like to be able to place a card with just those two values. Is there a way to write this functionality into the measure?

 

For reference, [Time Promised] and [Time Delivered] are measures which calculate the difference b/w start date and promise date, and start date and actual done date. 

 

Thank you in advance.

 

AverageTimeDiff =
CALCULATE(
    AVERAGEX(Projects, [Time Promised] - [Time Delivered]
    ),
    Projects[PromiseDate] <> BLANK()
)
7 REPLIES 7
eloomis
Advocate II
Advocate II

I don't think this works because I want the Min/Max of the average of each project type. This gives me Min/Max of the difference for each row (each individual project.) 

Hi @eloomis 

please tag the person you are referring to his response. Not sure if here you're referring to my response or to @amitchandak's

Apologies, I thought I was replying to @amitchandak's post, this comment was a reply to him. I will try your solution a little later today, thanks for the assistance.

tamerj1
Super User
Super User

Hi @eloomis 

please try

Longest Duration Project =
MAXX (
TOPN (
1,
ADDCOLUMNS ( VALUES ( Projects[Project Name] ), "@Duration", [AverageTimeDiff] ),
[@Duration]
),
Projects[Project Name]
)

Thanks for the response. This is not quite what I'm looking for, it returns the single project which was most over the deadline. 

 

I want to return the Max of the average for each type. In the image below, each project type has the averagetimediff displayed, so the Max project type would be Custom Software - Support & Evolve (352) and the Min project type would be Marketing - Marketing Plan (-135).  

 

eloomis_1-1672840579604.png

 

 

Hi @eloomis 

would you please share a screenshot of the measure code and the results that you are obtaining?

amitchandak
Super User
Super User

@eloomis , Try min/max value like

 

CALCULATE(
MINX(Projects, [Time Promised] - [Time Delivered]
),
Projects[PromiseDate] <> BLANK()
)

 

 

CALCULATE(
MAXX(Projects, [Time Promised] - [Time Delivered]
),
Projects[PromiseDate] <> BLANK()
)

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.

Top Solution Authors