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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
GarryPope
Advocate I
Advocate I

Previous Quarter

Hello Power BI Community,

I have a SharePoint List called AnimalList with two columns:

  • Title
  • My Date

I can show these in a table, as below:

GarryPope_1-1652109754138.png

But I want to show a card that displays the number of rows for the previous quarter.
So no matter what day I'm looking at the report, the card will only show the number of rows for the previous quarter. 

For the data in the screenshot above, the card would show 7 as today is 9th May 2022 so last quarter must have been January, February, March 2022. 

Any help would be greatly appreciated. I've looked at Microsoft Docs Previous Quarter but getting no luck. 

Thanks,

Garry

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @GarryPope ,

 

Please try the following to create a measure:

rows of previous quarter =
VAR _t =
    SUMMARIZE (
        'Table',
        'Table'[Title],
        'Table'[Date],
        "diff", DATEDIFF ( MAX ( 'Table'[Date] ), TODAY (), QUARTER )
    )
RETURN
    COUNTROWS ( FILTER ( _t, [diff] = 1 ) )

Output:

Eyelyn9_0-1652333974962.png

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @GarryPope ,

 

Please try the following to create a measure:

rows of previous quarter =
VAR _t =
    SUMMARIZE (
        'Table',
        'Table'[Title],
        'Table'[Date],
        "diff", DATEDIFF ( MAX ( 'Table'[Date] ), TODAY (), QUARTER )
    )
RETURN
    COUNTROWS ( FILTER ( _t, [diff] = 1 ) )

Output:

Eyelyn9_0-1652333974962.png

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@GarryPope , Make sure you have a date marked as a date table. And previousQuater needs a date to be selected on page

 

Try based on today

Last Qtr =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,Month(_max)))
var _min = eomonth(_min,-3)+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.