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.
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
Solved! Go to Solution.
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,...
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
)
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
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,...
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
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
97 | |
80 | |
66 | |
62 |
User | Count |
---|---|
145 | |
111 | |
104 | |
84 | |
64 |