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
BrendanJA
New Member

If # is within a range classify as X

Good afternoon,

 

I have a chart of accounts and I want to further categorize them to summarize the data. Is there a custom column formula I could create that would work like so;

 

1000-1999 = Asset

2000-2999= Liability

3000-3999 = Equity

4000-4999 = Revenue

5000-5999 = Expense

 

I know how to simply do this in excel with an if statement, but with the connecter I have with PowerBI to my accounting software I can not export from powerBI to excel and bring it back without breaking the real-time connector.

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @BrendanJA ,

 

There are many ways to do this.

=
SWITCH (
    TRUE (),
    [number] <= 1999, "Asset",
    [number] <= 2999, "Liability",
    [number] <= 3999, "Equity",
    [number] <= 4999, "Revenue",
    [number] <= 5999, "Expense"
)

 

=
SWITCH (
    VALUE ( LEFT ( [number], 1 ) ),
    1, "Asset",
    2, "Liability",
    3, "Equity",
    4, "Revenue",
    5, "Expense"
)

 

They are to be entered as a calc column. Replace [number] with the actual table and column name. The second one just checks for the first digit.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @BrendanJA ,

 

There are many ways to do this.

=
SWITCH (
    TRUE (),
    [number] <= 1999, "Asset",
    [number] <= 2999, "Liability",
    [number] <= 3999, "Equity",
    [number] <= 4999, "Revenue",
    [number] <= 5999, "Expense"
)

 

=
SWITCH (
    VALUE ( LEFT ( [number], 1 ) ),
    1, "Asset",
    2, "Liability",
    3, "Equity",
    4, "Revenue",
    5, "Expense"
)

 

They are to be entered as a calc column. Replace [number] with the actual table and column name. The second one just checks for the first digit.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thank you, both functions work 👍

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