Forum Discussion

Klasia's avatar
Klasia
Frequent Visitor
1 month ago
Solved

How show quantile in matrix

Hi, I have a table containing data with information about the task date, category, task ID, and task duration. Date Category ID Time 2026-01-01 A 32548A 422593 2026-07-10 A 10349C...
  • pankajnamekar25's avatar
    1 month ago

    Hello Klasia 

    PERCENTILE.INC interpolates, so it returns a synthetic value that doesn't actually exist in your data. To get the real row closest to that threshold, build a virtual table inside the measure (SUMMARIZE) it's used only for the calculation, never touches the visual, so no extra rows or slowdown.
    Quantile Actual Duration =
    VAR Threshold = PERCENTILE.INC('Table'[Time], 0.25)
    VAR VirtualTable =
    SUMMARIZE(
    'Table',
    'Table'[ID],
    "@Time", CALCULATE(MAX('Table'[Time]))
    )
    VAR ClosestRow =
    TOPN(1, VirtualTable, ABS([@Time] - Threshold), ASC)
    RETURN
    MAXX(ClosestRow, [@Time])

     

     


    If my response helped you, please consider clicking
    Accept as Solution βœ… and giving it a Like πŸ‘ – it helps others in the community too.

    Thanks,

    Connect with me on:
    LinkedIn |
    Data With Pankaj - YouTube