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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Migasuke
Solution Sage
Solution Sage

Previous Quarter of Previous Year

Hi,

I am searching for DAX solution, where in calculated column I mark most recent Q and also the same Q for previous year.
Here is my example (In Scope column is desired solution)

Migasuke_0-1652988797971.png

As we see, my latest data is for April 2022, which is Q2. Due to that I mark it as "Yes", but I also need to mark "Yes" the Q2 in previous year.

Any idea how to do it dynamic?



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

1 ACCEPTED SOLUTION
Whitewater100
Solution Sage
Solution Sage

Hello:

Can you try this calc column:(I added date table) and will attach file..https://drive.google.com/file/d/1W3cetda55qW0mKxle1XlAxKPSDQeot7w/view?usp=sharing 

IsCurrent/prev/Qtr =
IF (OR(
YEAR ( data[Date] ) = YEAR ( TODAY () )
&& QUARTER ( data[Date] ) = QUARTER ( TODAY () ), YEAR ( data[Date] ) = YEAR ( TODAY ()-365 )
&& QUARTER ( data[Date] ) = QUARTER ( TODAY () -365)),
"Yes",
"No"
)
Whitewater100_0-1652991182094.png

I hope this solves your question..Thanks

View solution in original post

2 REPLIES 2
Whitewater100
Solution Sage
Solution Sage

Hello:

Can you try this calc column:(I added date table) and will attach file..https://drive.google.com/file/d/1W3cetda55qW0mKxle1XlAxKPSDQeot7w/view?usp=sharing 

IsCurrent/prev/Qtr =
IF (OR(
YEAR ( data[Date] ) = YEAR ( TODAY () )
&& QUARTER ( data[Date] ) = QUARTER ( TODAY () ), YEAR ( data[Date] ) = YEAR ( TODAY ()-365 )
&& QUARTER ( data[Date] ) = QUARTER ( TODAY () -365)),
"Yes",
"No"
)
Whitewater100_0-1652991182094.png

I hope this solves your question..Thanks

Anonymous
Not applicable

HI if you have a date table it will be easy. Do you have it ?

https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.