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
Azzurra997
Helper I
Helper I

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 2022 as quarter but only as text. Because in the date/time format there is no quarter option. So when I filter the graph by quarter the bars are not displayed in chronological orders. How can I solve it?

 

Thanks

2 REPLIES 2
ichavarria
Solution Specialist
Solution Specialist

Hi @Azzurra997,

 

It´s difficult to provide you with detailed steps without more information. However, to solve this issue, you can create a calculated column in your date table that will extract the quarter from the date. You can then use this calculated column as a filter in your visualizations.

 

Here are the steps to create a calculated column:

 

  1. Go to the date table in Power BI and select "New Column" from the "Modeling" tab.

  2. In the formula bar, enter the following formula to extract the quarter from the date:

    Quarter = "Q" & CEILING(MONTH([Date])/3) & " " & YEAR([Date])

    This formula will create a new column with the quarter and year information in the format of "Q1 2022", "Q2 2022", etc.

  3. Click "Enter" to create the calculated column.

  4. Now, you can use this new column as a filter in your visualizations. In the "Visualizations" pane, select your bar chart and drag the "Quarter" column to the "Filters" section.

  5. Select the quarters you want to display in your bar chart and click "OK".

 

With this new calculated column, your bar chart should display the bars in chronological order based on the quarters.

 

Best regards, 

Isaac Chavarria

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

 

 

Just one thing to add to your formula.  There needs to be a 1 before the close of the CEILING function to designate the "significance" and round the calculated value to the nearest integer:

Quarter = "Q" & CEILING(MONTH([Date])/3, 1) & " " & YEAR([Date])

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.