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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Bidu
Frequent Visitor

Alternative to percentilex.inc(currentgroup(),...)

I am trying to do groupby()'s, and after do a "summarize" column, but currentgroup() doesn't work, otherwise if I use sumx() it works perfectly.


testTable = GROUPBY('tbl',Date[Year],Date[Month],'OS'[request.so],"X",PERCENTILEX.INC(CURRENTGROUP(),'tbl'[business_pause_duration],0.5))

Ps.: I can't use summarize because it are Table linked by relationships

1 REPLY 1
OwenAuger
Super User
Super User

Hi @Bidu 

Whether you use GROUPBY or SUMMARIZE, you should be able to use ADDCOLUMNS to add a column computing the percentile (which will iterate over rows of Sales corresponding to each group).

 

Either of these should work:

testTable =
ADDCOLUMNS (
    GROUPBY (
        'tbl',
        Date[Year],
        Date[Month],
        'OS'[request.so]
    ),
    "X",
        CALCULATE (
            PERCENTILEX.INC (
                Sales,
                'tbl'[business_pause_duration],
                0.5
            )
        )
)
testTable =
ADDCOLUMNS (
    SUMMARIZE (
        'tbl',
        Date[Year],
        Date[Month],
        'OS'[request.so]
    ),
    "X",
        CALCULATE (
            PERCENTILEX.INC (
                Sales,
                'tbl'[business_pause_duration],
                0.5
            )
        )
)

 

It wasn't clear from your description why you can't use SUMMARIZE.

If needed, could you provide more detail on your data model and some sample data and expected outputs?

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.