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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

How to get previous quarter data divided by month

Hi everyone,


im trying to calculate measure (a distinct count) of the last available quarter of a table minus one.


I've reached the result using this formula


Total sales_last quarter =
    DISTINCTCOUNT ( myMeasure ),
    FILTER (
        ALLSELECTED ( VW_MyTable ),
        VW_MyTable[Quarter] = MAX (VW_MyTable[Quarter] ) - 1
        && YEAR(VW_MyTable[DataSales]) = YEAR(MAX(VW_MyTable[DataSales]))
and this is the result:


however if i put the measure together with the month dimension i get the same result (207) over the last quarter

while i'm expeting 48(july) 73(august) and 76 (sept).

The last available date of the table is october2022 (q4 2022)


how can i achieve the result splitted by the last 3 months?

Frequent Visitor

Hi, i didnt understand your answer...
let me explain the situation.

Let us suppose that i have data for q4 of 2022 and im in q1 of 2023.
I would like to show only data of 2022 q4 divided by relative months (oct- Nov -Dec)
I need show the data table without any filter applied to the grapf (included date filter)

Thank you very much in advance.

Super User
Super User

@AresB , if you have a date use time intelligence


QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))

Qtr Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(ENDOFQUARTER('Date'[Date])))

Last QUARTER Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD( ENDOFQUARTER(dateadd('Date'[Date],-1,QUARTER))))
Last QUARTER Sales = CALCULATE(SUM(Sales[Sales Amount]),PREVIOUSQUARTER(('Date'[Date])))


Time Intelligence, Part of learn Power BI
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date:


Power BI — Qtr on Qtr with or Without Time Intelligence

Helpful resources

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors