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
JorgeAbiad
Helper III
Helper III

Insert Date Field in the Market Data table

Hello PBI experts,

 

I have a requirement to create probably bar/line chart show the budget and forecast values for each year starting from 2020 up to 2039. But the budget and forecast for each year are included in the same table.

In the required bar/line chart, the X-axis should be representd by Year. But the problem is there is no date dimension in the table that relates directly to forecast or budget. My question is how do I insert a Year field? Please help as I've been struggling on this for 2 weeks. Please  see below for sample data.

Market TypeNameCustomer GroupBudget 2024Budget 2022Budget 2020Budget 2021Budget 2023CountryPlatformCurrent FC 2024Current FC 2023Current FC 2022Current FC 2021Current FC 2020BrandRegion
Commercial VehicleMD market dataCust Group Test              
Platform Light VehicleAnother Market DataCust Group Test              
Platform Commercial Vehiclemarket data 3Cust Group Test              
Platform Light VehicleMQB37Volkswagen              
Platform Light VehicleMQB38Volkswagen              
Platform Light VehicleMLB(w)Volkswagen              
Platform Light VehicleMLB49Volkswagen              
Light VehicleA3 (-3) SB/LIM (CN)Volkswagen100000100000100000100000100000ChinaMQB37100000100000100000100000100000AUDIAsia
Light VehicleA3 (-4)SB/ Lim (CN)Volkswagen100000100000100000100000100000ChinaMQB38100000100000100000100000100000AUDIAsia
Light VehicleA4L (B10) (CN)Volkswagen100000100000100000100000100000ChinaMLB(w)100000100000100000100000100000AUDIAsia
Light VehicleA4L (B9) (CN)Volkswagen100000100000100000100000100000ChinaMLB49100000100000100000100000100000AUDIAsia

 

Thanks

JorgeAbiad

2 ACCEPTED SOLUTIONS
v-lid-msft
Community Support
Community Support

Hi @JorgeAbiad ,

 

We can use pivot to meet your requirement

 

1. Select All the budget and current fc columns, then pivot them 3.jpg

 

2. Replace the  “Current FC" with "Current_FC" to make split more easier4.5.jpg

 

3. Split Attribute column with space

 

5.jpg6.jpg7.jpg

 

 
If it doesn't meet your requirement, Could you please show the exact expected result based on the Tables that you have shared.
 


Best regards,

 

Community Support Team _ Dong Li
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

Hi @JorgeAbiad ,

 

We can just put the fields into line chart as following after pivot to meet your requirement:

 

1.jpg

 


Best regards,

 

Community Support Team _ Dong Li
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

8 REPLIES 8
v-lid-msft
Community Support
Community Support

Hi @JorgeAbiad ,

 

We can use pivot to meet your requirement

 

1. Select All the budget and current fc columns, then pivot them 3.jpg

 

2. Replace the  “Current FC" with "Current_FC" to make split more easier4.5.jpg

 

3. Split Attribute column with space

 

5.jpg6.jpg7.jpg

 

 
If it doesn't meet your requirement, Could you please show the exact expected result based on the Tables that you have shared.
 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-lid-msft ,

 

Thank you for your response. I will try this approach if this will work according to the requirement.

I'm quite new to Power BI so I am not yet fully aware of its awesome features.

I would like to clarify the following questions:

1. How do I choose all the Budget and Forecast columns? Sorry but I could not find the way to select multiple columns all at the same time.

2. After pivoting the columns selected above, will they remain in the original table?

3. What will happen to the new records added to the original table? Will they be transformed or pivoted automatically?

Thank you very much again:)

 

Regards

JorgeAbiad

Hi @JorgeAbiad ,

 

Sorry for our late reply, We can use ctrl to multi choose the column,  After pivoting the columns selected above, they will not remain in the original table, if you want to keep the origin table, we suggest you to duplicate one, If the new record is row, it will be pivote after each refresh, but the new column might need to change the query.

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-lid-msft ,

 

Please see attached file. It contains the data after unpivoting the columns.

Is it possible to create a line chart out of the three columns?

Thanks:)

 

Regards,

JorgeAbiad

Hello @v-lid-msft 

Thank you very much!

I was able to do it. However, that leads me to another requirement now. How am I going to create a line  chart to show the budget and current forecast for each year(2020 - 2036)? Or this even possible? Do I need to calculte the budget and forecast for each year?

 

Regards,

JorgeAbiad

 

Hi @JorgeAbiad ,

 

We can just put the fields into line chart as following after pivot to meet your requirement:

 

1.jpg

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello  @v-lid-msft,

 

Thank you for all the support you have provided so far.

I have a new requirement which I think seems to be a bit complex. In the matrix below, there are years when there is data for the budget. The deviation for each year between budget and forecast is required. 

I'm not sure if the simple Current Forecast - Budget will do the correct calculation considering there are null values in the Budget row. My question is how to get the correct deviation or difference>

 

JorgeAbiad
Helper III
Helper III

Hello PBI experts,

 

If you think of any possible solution to this, please share it.

Thanks

 

Regards

JorgeAbiad

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.