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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
icbd
Helper I
Helper I

Create top X table visual

Good morning all,

 

I am registering faults on a machine, where I have start time, end time and description of all faults. I am trying to get a table visual to only display the longest duration fault for each. I'm getting duplicates and I'm not too sure I understand why, see image below.

 

icbd_0-1634221408114.png

 

I only want the max value per each description, which is not what I'm getting. Any help would be appreciated.

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @icbd ,

 

First create a measure to get your MAX duration:

_maxDuration = MAX(yourTable[Duration])

 

Then create a measure that picks out your [Fault Start] date where the duration is the MAX:

_maxFaultStart = 
VAR __maxStart =
MAX(yourTable[Duration])
RETURN
CALCULATE(
    SELECTEDVALUE(yourTable[Fault Start]),
    yourTable[Duration] = __maxStart
)

 

Put [Description], [_maxDuration], and [_maxFaultStart] into a table and it should do want you need.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
BA_Pete
Super User
Super User

Hi @icbd ,

 

First create a measure to get your MAX duration:

_maxDuration = MAX(yourTable[Duration])

 

Then create a measure that picks out your [Fault Start] date where the duration is the MAX:

_maxFaultStart = 
VAR __maxStart =
MAX(yourTable[Duration])
RETURN
CALCULATE(
    SELECTEDVALUE(yourTable[Fault Start]),
    yourTable[Duration] = __maxStart
)

 

Put [Description], [_maxDuration], and [_maxFaultStart] into a table and it should do want you need.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Wouldn't this return only a single value? Not too sure this will achieve what I need.

Hi @icbd ,

 

Yes, it will return a single value (the maximum), but when you add context (by including [Description] in the table) it will be evaluated only over the [Description] group thus giving you the maximum values per [Description], as per your requirement: "I only want the max value per each description".

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Thank you, I was able to get this to work. Much appreciated.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Solution Authors
Top Kudoed Authors