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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Syndicate_Admin
Administrator
Administrator

Grouping data by dates

Good!

I have created a line graph in which on the horizontal axis you have the time and on the vertical axis a measurement.

I want to create a filter that is similar to the one in the following image:

Luisch_0-1724839923979.png

In which, the option to group by date if I select "By months" shows me the data grouped by months, if I select "By days" I do it by days and if I select by years I do it by years. That is, the horizontal axis of my graph varies automatically according to the selection I make in the second filter.

Thank you!

1 ACCEPTED SOLUTION
v-heq-msft
Community Support
Community Support

Hi @Syndicate_Admin ,
According to your description, you can create a column corresponding to the year, month, and day based on your date, and then use the year, month, and day columns to create a filed parameter and put this parameter into the x-axis of the line graph, as follows
Create day, month,year column

DAY = DAY('Table'[Date])
MONTH = MONTH('Table'[Date])
YEAR = YEAR('Table'[Date])

Use these columns as filed parameter value

vheqmsft_0-1724914735589.png

vheqmsft_1-1724914749227.png

Use parameter as x-axis

vheqmsft_2-1724914772001.png

Final output

vheqmsft_3-1724914801540.png

vheqmsft_4-1724914814402.png

 

Best regards,
Albert He


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

2 REPLIES 2
v-heq-msft
Community Support
Community Support

Hi @Syndicate_Admin ,
According to your description, you can create a column corresponding to the year, month, and day based on your date, and then use the year, month, and day columns to create a filed parameter and put this parameter into the x-axis of the line graph, as follows
Create day, month,year column

DAY = DAY('Table'[Date])
MONTH = MONTH('Table'[Date])
YEAR = YEAR('Table'[Date])

Use these columns as filed parameter value

vheqmsft_0-1724914735589.png

vheqmsft_1-1724914749227.png

Use parameter as x-axis

vheqmsft_2-1724914772001.png

Final output

vheqmsft_3-1724914801540.png

vheqmsft_4-1724914814402.png

 

Best regards,
Albert He


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

 

 

 

 

Anonymous
Not applicable

@Syndicate_Admin can u help me pls. I posted something about expanding tables and my questions is not good formulated. Can you look over it?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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