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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors