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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
iioannou
Helper I
Helper I

Custom Column with Custom Data

Hello everyone,

 

I am new to Power BI and I would like to ask how I can achieve something...

 

Basically I want to create a new column e.g Budget and I want to insert a value in it based on the dates month of that record which has a value to the next column. e.g

 

01-01-2018 - this means january so lets say my Budget for january is 10 000

01-02-2018 - this means February so lets say my Budget for February is 15 000

01-03-2018 - this means March so lets say my Budget for january is 20 000

01-04-2018 - this means April so lets say my Budget for january is 25 000

and so on for the rest of the months...

 

I have lets say around 4000 records - so what I am after is so that all of them can be updated based on the information above and this should also work for next year. I want it to match only the month name or number

2 ACCEPTED SOLUTIONS

Typically you would do this in the data itself and load it. But, you can either use a nested IF statement or (preferred) use a SWITCH statement, so something like:

 

Column = SWITCH(MONTH([Date]),1,10000,2,15000,3,20000,...

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Thank you for the message. I achieve it like this for anyone who might come to this post and could need it.

 

Budget = SWITCH('Rooms'[StatisticDateMonth],"January", 136, "February", 158, "March", 146, "April", 141, "May", 140, "June", 162, "July", 162, "August", 171, "September", 172, "October", 171, "November", 173, "December", 100
)

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

Can you try re-explaining this?

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Yes of course. I have a table which consits of 10 columns for example. One of them is the Date column. I want to create a new column now called Budget which will contain a custom value, but I want this value to be different based on the month of the date column.

 

For example if I run this Budget = 10000 it will add for all records 10 000 as a value.

 

What I want, is like

Budget = IF Month = January then Budget = 10000 elseIF Month = February then Budget = 15000  and so on for the rest of the months

 

Typically you would do this in the data itself and load it. But, you can either use a nested IF statement or (preferred) use a SWITCH statement, so something like:

 

Column = SWITCH(MONTH([Date]),1,10000,2,15000,3,20000,...

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank you for the message. I achieve it like this for anyone who might come to this post and could need it.

 

Budget = SWITCH('Rooms'[StatisticDateMonth],"January", 136, "February", 158, "March", 146, "April", 141, "May", 140, "June", 162, "July", 162, "August", 171, "September", 172, "October", 171, "November", 173, "December", 100
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.