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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Error calculating QOQ% using quick measure

a.PNG

 

NET_SALES QoQ% =
IF(
ISFILTERED('Calendar'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
VAR __PREV_QUARTER =
CALCULATE(
SUM('research ra_qtr_template'[NET_SALES]),
DATEADD('Calendar'[Date].[Date], -1, QUARTER)
)
RETURN
DIVIDE(
SUM('research ra_qtr_template'[NET_SALES]) - __PREV_QUARTER,
__PREV_QUARTER
)
)

 

How to acheive QOQ% using Quick measeure.

Can you help me out. How to fix it.

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

Hi @Anonymous

Assume "research ra_qtr_template" table has a "date" column

you could create such measures

total this quarter = 
CALCULATE(SUM(Sheet3[net_sales]),FILTER(ALLEXCEPT(Sheet3,Sheet3[code]),[Quarter]=MAX([Quarter])))

PREV_QUARTER = 
CALCULATE(SUM(Sheet3[net_sales]),FILTER(ALLEXCEPT(Sheet3,Sheet3[code]),[Quarter]=MAX([Quarter])-1))

QOQ% = ([total this quarter]-[PREV_QUARTER])/[PREV_QUARTER]

10.png

 

Also the three measures could put into one measure

QQQ%=
var total this quarter = 
CALCULATE(SUM(Sheet3[net_sales]),FILTER(ALLEXCEPT(Sheet3,Sheet3[code]),[Quarter]=MAX([Quarter])))

var PREV_QUARTER = 
CALCULATE(SUM(Sheet3[net_sales]),FILTER(ALLEXCEPT(Sheet3,Sheet3[code]),[Quarter]=MAX([Quarter])-1))

Return  (total this quarter-PREV_QUARTER) / PREV_QUARTER

The "Quarter" column can be created by going to Edit Queries, then click on the "date" column, then select Transform->Date->Quarter->Quarter of year.

 

Best Regards

Maggie

 

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Assume "research ra_qtr_template" table has a "date" column

you could create such measures

total this quarter = 
CALCULATE(SUM(Sheet3[net_sales]),FILTER(ALLEXCEPT(Sheet3,Sheet3[code]),[Quarter]=MAX([Quarter])))

PREV_QUARTER = 
CALCULATE(SUM(Sheet3[net_sales]),FILTER(ALLEXCEPT(Sheet3,Sheet3[code]),[Quarter]=MAX([Quarter])-1))

QOQ% = ([total this quarter]-[PREV_QUARTER])/[PREV_QUARTER]

10.png

 

Also the three measures could put into one measure

QQQ%=
var total this quarter = 
CALCULATE(SUM(Sheet3[net_sales]),FILTER(ALLEXCEPT(Sheet3,Sheet3[code]),[Quarter]=MAX([Quarter])))

var PREV_QUARTER = 
CALCULATE(SUM(Sheet3[net_sales]),FILTER(ALLEXCEPT(Sheet3,Sheet3[code]),[Quarter]=MAX([Quarter])-1))

Return  (total this quarter-PREV_QUARTER) / PREV_QUARTER

The "Quarter" column can be created by going to Edit Queries, then click on the "date" column, then select Transform->Date->Quarter->Quarter of year.

 

Best Regards

Maggie

 

Anonymous
Not applicable

@v-juanli-msft  I attempted to do the same calculation, and then visualize my % change quarter over quarter as a bar graph for quarters 2018 - quarters 2019. The problem is my measures currently show some "Infinity" values for the earliest quarter so I cannot filter the date hierarchy on my original fact table's "date" column down the year+quarter level in the graph. Any advice? I set up a calculated table column (to order my quarters from year to year) and QoQ measure from the following blog post (https://stackoverflow.com/questions/57757128/qoq-measures-in-power-bi).

 

I need a way to get rid of the infinity values now for graphing purpose, but when I filter out the quarter that contains infinity values in the filters pane, the graph automatically picks the next earliest quarter and makes that an infinity value... any way around this?

 

 

Thanks!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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