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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
agd50
Helper V
Helper V

Dax - Previous Quarter error Help

I have made an error with my calculation - I didn't account for the q1 of the new year - instead I get 0Q. I would like to show the previous quarter, including showing Q4 of last year in the first calendar year quarter. Got any ideas?

 

 

Previous Quarter Year Title = 
 Var Year = INT ( YEAR ( TODAY () ) )
 Var Quarter = INT ( FORMAT(NOW (),
 "q" ) )

 Return
 
 "Q"&Quarter-1 &"," & " " & Year

 

agd50_0-1704166776473.png agd50_1-1704166794533.png (Should instead show Q4 of last year for the text)

 

TIA

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Community Champion
Community Champion

the best practice is to create a date table, and use the time intelligense functions.

or try this

return "Q"&IF(Quarter=1,Quarter+3 &", "&Year-1,Quarter-1&", "&Year)

View solution in original post

1 REPLY 1
wdx223_Daniel
Community Champion
Community Champion

the best practice is to create a date table, and use the time intelligense functions.

or try this

return "Q"&IF(Quarter=1,Quarter+3 &", "&Year-1,Quarter-1&", "&Year)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.