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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Group of column in x-axis for clustered column chart

Hi Community..!!

PatilPrasad027_0-1717483002172.png

Please refer above image,

I want to display 6 month of data in one bar,

i have already calculated the measure.

As u can see the legends on to the chart,

Planned : Jul - Dec 24 in single bar 

Optimized : Jul - Dec 24 in single bar 
X-axis will be changing based on slicer selection.

Can we built it using Clustered Column chart ?

Or can we get a result in same fasion in other chart  also?

Please guide me on this.

 

Thanks in advance..!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Sure @Anonymous 

I have created two measures by using below logic 

Spend Optimize month range 2-6 =
var selected_month = MAX('Automated Monthly'[Month-Year])
var futureTwoMonths = EOMONTH(selected_month,1) + 1
var futureSixMonths = EOMONTH(futureTwoMonths,5)
var result = CALCULATE(SUM('Automated Monthly'[Optimized Spend]),
                        'Automated Monthly'[Month-Year] >= futureTwoMonths &&  'Automated Monthly'[Month-Year] <= futureSixMonths)        
RETURN result
Same logic for second measure.
PatilPrasad027_0-1718087412059.png

Refer above image, No 1. I have used above measure and for No.2 (Its a card visual)I have used below measure

6 month range =
var selected_month = SELECTEDVALUE('Automated Monthly'[Month-Year])
var futureTwoMonths = EOMONTH(selected_month,2)
var futureSixMonths = EOMONTH(futureTwoMonths,5)
RETURN FORMAT(futureTwoMonths,"mmm") & "- " & FORMAT(futureSixMonths, "mmm'yy")
 
Please let me know if u have any doubts.
Thanks

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi Community..!!

I got the output.

Thank U..!!

Anonymous
Not applicable

Hi, @Anonymous 

Glad to hear you solved the problem yourself!  
If you can, please share your solution, which will be beneficial for future users to read this post. 

 

Best Regards

Yongkang Hua

Anonymous
Not applicable

Sure @Anonymous 

I have created two measures by using below logic 

Spend Optimize month range 2-6 =
var selected_month = MAX('Automated Monthly'[Month-Year])
var futureTwoMonths = EOMONTH(selected_month,1) + 1
var futureSixMonths = EOMONTH(futureTwoMonths,5)
var result = CALCULATE(SUM('Automated Monthly'[Optimized Spend]),
                        'Automated Monthly'[Month-Year] >= futureTwoMonths &&  'Automated Monthly'[Month-Year] <= futureSixMonths)        
RETURN result
Same logic for second measure.
PatilPrasad027_0-1718087412059.png

Refer above image, No 1. I have used above measure and for No.2 (Its a card visual)I have used below measure

6 month range =
var selected_month = SELECTEDVALUE('Automated Monthly'[Month-Year])
var futureTwoMonths = EOMONTH(selected_month,2)
var futureSixMonths = EOMONTH(futureTwoMonths,5)
RETURN FORMAT(futureTwoMonths,"mmm") & "- " & FORMAT(futureSixMonths, "mmm'yy")
 
Please let me know if u have any doubts.
Thanks
Kishore_KVN
Super User
Super User

Hello @Anonymous , 

Dont create measures with months in the consideration, Keep months open in a new column and create your measures only for Planned and Optimized then get that month column in X axis and these measures in Y axis to plot proper visual. 

 

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

Anonymous
Not applicable

Hi @Kishore_KVN 

Thanks for the quick reply.

But i want to show only 6 months of data.

ex: in slicer if i select Jan then in the graph from March to Aug data will be displayed.

in slicer if i select Feb then in the graph from April to Sept data will be displayed and so on.....!!
Could u please provide me guidance for the same..!!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors