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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
erlingsa
Regular Visitor

Mapping categories to records based on ranges

Hi,

I am facing a DAX challenge and would very much appreciate help with this. I have a general ledger table and a mapping table catergorizing the accounts based on ranges. In Excel I probably would use the VLOOKUP-formula to allocate the category to each line of data. I want to do this in Power BI as well.


I have thought of two possible solutions:

1. Create a calculated column in the General ledger table that selects the appropriate category
2. Create a measure that summarizes the values of each category based on the ranges


However, this was not as straightforward as in Excel. I would appreciate any help with how I should go about solving this. I suppose there is a "best practice" method for this kind of problem that I am not aware of.
PBI.jpg

 

 

1 ACCEPTED SOLUTION

Thank you very much for your response @amitchandak. It was not quite what I was looking for, but I fould an answer by looking a bit further, and post the solutions here in order to help future readers of this post.

Option 1 can be solved with Static segmentation (https://www.daxpatterns.com/static-segmentation/)
Option 2 can be solved with Dynamic segmentation (https://www.daxpatterns.com/dynamic-segmentation/)

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@erlingsa, try option 2 unless it's too complicated to do so

See:https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

https://radacad.com/parsing-organizational-hierarchy-or-chart-of-accounts-in-power-bi-with-parent-ch...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@erlingsa , Try Option 2 unless that is too complicated to do that

 

Refer:https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

https://radacad.com/parsing-organizational-hierarchy-or-chart-of-accounts-in-power-bi-with-parent-ch...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you very much for your response @amitchandak. It was not quite what I was looking for, but I fould an answer by looking a bit further, and post the solutions here in order to help future readers of this post.

Option 1 can be solved with Static segmentation (https://www.daxpatterns.com/static-segmentation/)
Option 2 can be solved with Dynamic segmentation (https://www.daxpatterns.com/dynamic-segmentation/)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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