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
TBSST
Frequent Visitor

Grouping dates in a bar chart by month

Hi All, 

 

I am trying to create a bar chart to show the number of responses by month. The two colums i have is response ID's (y-Axis) and response date (X axis, format dd-mmm-yyyy). 

 

I am wanting to group the dates together so the bar chart is showing responses in a month, not an indiidual day. The response date data type is set to date/time. 

 

Any help would be appreciated. 

2 REPLIES 2
Ritaf1983
Super User
Super User

Hi @TBSST 
If you working with 1 table of fact :
You can add a column with the month:

Ritaf1983_1-1694142268234.png

and put it to X axis

Ritaf1983_2-1694142363639.png

 

The best Practise to work with dates is to create a date table and "use" it :

Ritaf1983_0-1694142803576.pngRitaf1983_1-1694142843266.png

Link to a sample file with both options 

For more informations about dates table:

https://www.datacamp.com/tutorial/how-to-create-date-tables-in-power-bi-tutorial

 

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Ashish_Mathur
Super User
Super User

Hi,

Seperate time from the Date/Time column.  Create a Calendar Table and then a relationship from the Date column of the Data Table to the Date column of the Calendar Table.  In the Calendar Table, create calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number.  To your visual, drag Year and Month name from the Calendar Table.  Write this measure

Measure = countrows(Data)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.