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

Calculate the previous date for each item

Hi All,

 

I want to create a Card graph wherein the Score for this specific team for a specific Quarter Shows

Splicers would be Year and Quarter. Then Card shows Score of each team (team A and B)

 

For the query question, the solution I can think of is that i want to create a column (not a measure since there would be no total calculation of Scores) for Previous quarter Dates. I have a "Logging Date" wherein users log their Score but it's for a previous quarter.

 

Data sample below is the calculated quarter based on the date:

DateTeamScore (1-10)YearPrefix
5/2/2019Team A62019Q2
5/10/2019Team B72019Q2
8/4/2019Team A62019Q3
8/15/2019Team B82019Q3
10/2/2019Team A92019Q4
10/2/2019Team B92019Q4
1/3/2020Team A82020Q1
1/10/2020Team B102020Q1

 

I would like to create a column showing that this Score is actually for a previous quarter (see 2 columns below) 

DateTeamScore (1-10)YearPrefixPrev QtrPrevious Qtr Yr
5/2/2019Team A62019Q2Q12019
5/10/2019Team B72019Q2Q12019
8/4/2019Team A62019Q3Q22019
8/15/2019Team B82019Q3Q22019
10/2/2019Team A92019Q4Q32019
10/2/2019Team B92019Q4Q32019
1/3/2020Team A82020Q1Q42019
1/10/2020Team B102020Q1Q42019

 

I have tried doing the basic conditional formatting wherein if Quarter shows Q4 then change to Q3, Q3 to Q2, etc. but When doing a splicer for Quarter and Year, the date for 1/3/2020 and 1/10/2020 should be for Q4 2019 not Q4 2020.

 

I'm not sure if there's any other way around with the final outcome that I want. I'm okay with a different approach.

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Burubear ,

 

Please create calculate columns as below.

YEAR pre = YEAR(EDATE('Table'[Date],-3))
Q pre = "Q" & QUARTER(EDATE('Table'[Date],-3))

Capture.PNG

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @Burubear ,

 

Please create calculate columns as below.

YEAR pre = YEAR(EDATE('Table'[Date],-3))
Q pre = "Q" & QUARTER(EDATE('Table'[Date],-3))

Capture.PNG

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

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.

Top Solution Authors
Top Kudoed Authors