Forum Discussion

woodsykris's avatar
woodsykris
Copper Contributor
Dec 28, 2024
Solved

Percentages in Pivot Table

Hi, Here is a sample pivot table in which I am trying to determine the percentage of notes doctors are blocking. How do I get the third column (H) to show the percentage of blocked notes? Obvious...
  • Patrick2788's avatar
    Dec 31, 2024

    I'm not sure if you're looking to do G/F or G/Total so I've included both options using GROUPBY.

    for G/F:

    =GROUPBY(
        SampleTbl[Doctor],
        SampleTbl[Shared with Patient],
        HSTACK(COUNT, SUM, LAMBDA(v, SUM(v) / COUNT(v)))
    )

    for G/Total:

    =GROUPBY(
        SampleTbl[Doctor],
        SampleTbl[Shared with Patient],
        HSTACK(COUNT, SUM, PERCENTOF)
    )

     

Resources