Forum Discussion
Anonymous
3 years agoNot applicable
Quarter as Date in parameters
Hi AIl In my powerbi report I used the parameters option to filter a bar chart by day, by month and by year. I would like to do the same by quarter, but power bi doesn't recognize Q1 2022 or Q3 2...
suparnababu8
Super User
2 years ago
QuarterDate =
DATE(
YEAR([Date]),
SWITCH(
TRUE(),
FORMAT([Date], "q") = "1", 1,
FORMAT([Date], "q") = "2", 4,
FORMAT([Date], "q") = "3", 7,
FORMAT([Date], "q") = "4", 10
),
1
) In your date table, add a calculated column that combines the year and quarter into a date format. Here’s above an example DAX formula:Use the Calculated Column in Your Visual: Drag the QuarterDate column to the axis of your bar chart. This will ensure that the bars are displayed in chronological order.
Filter by Quarter: In the “Visualizations” pane, drag the QuarterDate column to the “Filters” section.
- Duinhir2 years agoNew Member
Thank you suparnababu8,
the sorting problem is solved, and to be honest it could be fine to leave like it is.
Is there any chance to display it instead of the months: Q1, Q2 and so forth?
Below it's how it looks now. I chose "(yyyy-mm)" in the column format, which is the closest to what I'd like to show.
Thank you very much for your support!
Kind regards
Fabio