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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
jonathan_nz
Frequent Visitor

Assigning a Date to a Calculated Column or Measure then Displyaing using a Clustered Column Chart

I need help with creating a Clustered Column Chart. I am a Power Bi novice (couple of months under my belt).

 

The problem:

 

I am working with sales data that is generated over multiple months (its a rental car business).

 

For example, a booking will have a pickup date of say 30 January and a drop off date of say 5 February. I have used a calculated column to allocate the number of 'booking days' across the different months (i.e. 2 days in January and 5 days in February). This calculated column is then multiplied by the daily rate to get revenue per month. I have 12 calculated columns (or measures) for the 2017 calendar year (one for each month). I have tried to graph this data but the results are not satisfactory when you have 12 months of data (the columns get smaller and smaller).

 

What I need to do is somehow assign a date to each monthly sales total but am struggling to do this. I have tried to create a 'date' column using if statements but this does not seem to work as the sales data is over multiple time periods / columns and the if statement can only assign one date per row. I need to somehow 'fix' or create an 'absolute' sales amount per month and then assign a date to that fixed amount - but I can't work out how to do this.

 

Monthly Sales (note: no shared axis value - this needs to be in months)

 

Capture LR.JPG

 

 

 

This is what happens if I use an if statement to assign a date, it picks up February sales (dark green) where there is also a January sale (i.e. a booking across multiple months) and includes the result in January. This data should be in February (and combine with the other February data). You will note that there is now a shared axis though (which is want I am after) and visually the clustered column chart looks better.

 

Capture LR 2.JPG

Thanks in advance for any assistance you can provide. I am wasting way too much time on this!

 

If you want to look at my DAX formulas let me know. They are all pretty basic. 

 

Regards, Jonathan

 

3 REPLIES 3
parry2k
Super User
Super User

You explained well, but it will be nice to see some sample data to provide help.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Sure, I'm not sure how to upload an excel file, so here is a snapshot of the data I am working with:

 

pickup_datedropoff_date7 - Total Day Count6 - Daily SalesC - January 2017 Day CountC - February 2017 Day CountM - January 2017 SalesM - February 2017 Sales
30/09/20166/02/2017129$42.90316$1,329.90$257.40
6/01/201730/03/201783$72.682528$1,817.00$2,035.04
10/01/201727/03/201776$42.142128$884.94$1,179.92
3/11/20167/01/201765$68.937 $482.51 
7/11/20164/01/201758$88.724 $354.88 
18/11/201613/01/201756$44.6413 $580.32 
8/02/201727/03/201747$59.44 20 $1,188.73
10/12/201624/01/201745$48.9224 $1,174.08 
20/01/20173/03/201742$47.941128$527.31$1,342.24

 

Dates are in NZ format, so the day and month are opposite to the US convention.

 

Cheers, Jonathan

Anonymous
Not applicable

Hi @jonathan_nz,

 

It is hard to use measure or calculate column to modify the display graphic, perhaps you can try to write a measure to calculate the next month amount based on current month.

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors