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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Nihed
Helper III
Helper III

Dax need

You will see that there is a quarter selection on dashboard:

 

Nihed_0-1637922050103.jpeg

 

 

This selection comes from an excel file, however it is not great because users sometimes forget to update this excel file.

Instead of that, can we create a table which is dynamically filled with quarters and replace that excel selection?

New table should include quarters from last 5 years until current quarter.

The dashboard should always select current quarter automatically.

 

how can I please do this

4 REPLIES 4
amitchandak
Super User
Super User

@Nihed , You need to create column like this in your date table and save that in This Qtr

 

Switch( True() ,

format(today(), "YYYY - \QQ") = [Qtr Year] , "This Qtr",

[Qtr Year]

)

 

 

Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

thank you for your answer
just for information I don’t have a date table in my report I use an EXCEL file with this data and I wanted to create this data in a direct dynamic table to have  "QUARTER SELECTION " in Power BI how I can do please?

the data of the execel file:

Nihed_0-1637927564383.png

 

 

Hi, @Nihed 

You can try following code  to manually create a calendar table to replace data in EXCEL file.

Calendar date = CALENDAR(DATE(2017,01,01),TODAY()) //calculated table

calculated columns:

Quarter = FORMAT('Calendar date'[Date],"YYYYQ")
Num quarter = 
VAR _year =
    YEAR ( TODAY () )
VAR _quarter =
    QUARTER ( TODAY () )
VAR _last_quarter =
    IF ( _quarter = 1, _year - 1 & "4", _year & _quarter - 1 )
RETURN
    IF (
        'Calendar date'[New quarter] = _last_quarter,
        "last quarter",
        'Calendar date'[New quarter]
    )

22.png

Due to the use of calculated table, you still need to refresh the calendar table to get the latest data.

 

Best Regards,
Community Support Team _ Eason

Hello,

It works very well I did exactly the same thing, thank you very much for your help

 

Thank you.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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