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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
carlomendoza
Regular Visitor

PowerBI Bin Feature not giving the same result as Excel FREQUENCY()

I just tried out the group bin feature in PowerBI desktop, but it seems it doesn't behave the same way as Excel's FREQUENCY() function. See picture. Is there a way make it match how FREQUENCY works? Don't mind the colors and bar widths. I'm talking about the values of the bars being different.

 

Untitled234234.png

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @carlomendoza,

 

The Group bin feature in PowerBI desktop is not the same as that in Excel. It only supports specific interval (bin size) that displayed in x-axis. For example, the x-axis can show value like 0,5,10,15,etc, but cannot show values as 0,5,6,8,9,etc. which is supported in Excel. That is the reason why the values of the bars are different.

 

In PowerBI, you can try the workaround below. First, you need a table with bin data and add an index column (in query edit) to it. Use the following formula to add an calculate column:

BinStart =
SUMX (
    FILTER ( BinTable, BinTable[index2] = EARLIER ( BinTable[index2] ) - 1 ),
    BinTable[BinEnd]
)


3.PNG            4.PNG

Then, cross join the Bin table with the table which contains the value columns need to be count. Create a calculate table based on that crossjoin table: 

CrossJoin = CROSSJOIN(Bin,BinTable)

NewTable =
CALCULATETABLE (
    'CrossJoin',
    FILTER (
        'CrossJoin',
        'CrossJoin'[Values] > 'CrossJoin'[BinStart]
            && 'CrossJoin'[Values] <= 'CrossJoin'[BinEnd]
    )
)

column = NewTable[BinStart]&"~"&NewTable[BinEnd]

5.PNG

 

Then, use the last table view to create bar chart. 

6.PNG

 

Thanks,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
carlomendoza
Regular Visitor

Are there new features that make this easier?

 Yes, now its much easier. PowerBI has a "group" feature that you can use. Simply right click on the Field and select New Group and you can do it that way. 

v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @carlomendoza,

 

The Group bin feature in PowerBI desktop is not the same as that in Excel. It only supports specific interval (bin size) that displayed in x-axis. For example, the x-axis can show value like 0,5,10,15,etc, but cannot show values as 0,5,6,8,9,etc. which is supported in Excel. That is the reason why the values of the bars are different.

 

In PowerBI, you can try the workaround below. First, you need a table with bin data and add an index column (in query edit) to it. Use the following formula to add an calculate column:

BinStart =
SUMX (
    FILTER ( BinTable, BinTable[index2] = EARLIER ( BinTable[index2] ) - 1 ),
    BinTable[BinEnd]
)


3.PNG            4.PNG

Then, cross join the Bin table with the table which contains the value columns need to be count. Create a calculate table based on that crossjoin table: 

CrossJoin = CROSSJOIN(Bin,BinTable)

NewTable =
CALCULATETABLE (
    'CrossJoin',
    FILTER (
        'CrossJoin',
        'CrossJoin'[Values] > 'CrossJoin'[BinStart]
            && 'CrossJoin'[Values] <= 'CrossJoin'[BinEnd]
    )
)

column = NewTable[BinStart]&"~"&NewTable[BinEnd]

5.PNG

 

Then, use the last table view to create bar chart. 

6.PNG

 

Thanks,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

I just found a much easier and faster way to do the same thing.  All you have to do is go into edit queries and add a conditional column.  Then start from the largest bin and start adding conditions "greater than" next interval.  See full example here:  http://exceleratorbi.com.au/conditional-columns-power-bi-desktop/

 

After you add the conditional column, you can then create visuals on that conditional column.  

KUDOS!!  It does work, but It takes a loonnggg time to follow & create 3 tables just to put the counts into bins!  Wow, excel is much easier, just one simple 10-sec function called "Frequency".  Power BI needs to do something about that!  But thanks so much for your help!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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