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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ChrisHokstad
New Member

Convert from a range of GL accounts to another GL account for a selection of dimensions

Hi

 

I have all my GL data in a SQL database, but for presentation purposes in PBI, I need to convert some of the accounts from Payroll (5000-series) to COGS (4000 series), and only for 2 out of 50 departmens (dimensions). See below how I think. I need to convert a range og accounts (5000-5999) for department 211 and 212 to account 4350:

 

ChrisHokstad_0-1631875094979.png

 

 

Is this even possible?

 

Thanks,

 

Chris

1 ACCEPTED SOLUTION

Hi @ChrisHokstad ,

 

Try this:

Column =
VAR AccountRange_ = GENERATESERIES(5000,5999,1)
RETURN
if( [Account] IN AccountRange_ && [Department] in {211,212} , 4350, [Account])
Icey_0-1632208864421.png

 

 

Best Regards,

Icey

 

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

4 REPLIES 4
amitchandak
Super User
Super User

@ChrisHokstad , A new column

 

if( [Account] = 5010 && [Department] in {211,212}  , 4350, [Account])

 

In case columns are text the use double quote , like = "5010"

Thanks @amitchandak , this works, but how could I use this formula on a range of accounts i.e from account 5000..5999?

Hi @ChrisHokstad ,

 

Try this:

Column =
VAR AccountRange_ = GENERATESERIES(5000,5999,1)
RETURN
if( [Account] IN AccountRange_ && [Department] in {211,212} , 4350, [Account])
Icey_0-1632208864421.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks alot @Icey , this worked fine!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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