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
CJDK
Helper II
Helper II

Cannot get quarterly difference matrix to work

I am trying to build a matrix that compares the differences from one quarter to another - actual differences or percentage differences.

 

I have tried copying several examples without success. The examples use numeric values (e.g. Sales in USD), but the values I am using are not numeric, but strings (e.g. "Sales visit" or "Contract signed"). Therefore I cannot use SUM and have been trying with COUNT instead:

SupportTypeCount = COUNT(MyTable[Support type])

 

In the matrix the rows are the "Support types" and the columns are Quarters:

Quarter = FORMAT([Date], "\QQ yyyy")

 

So far, so good. But I cannot find the correct measure for the values - I have tried numerous combinations, also using a Date Calendar, but all have failed:

QuarterlySupportChange = DIVIDE(MyTable[SupportTypeCount], CALCULATE([SupportTypeCount], DATEADD('Date'[Date], -1,QUARTER)),0)-1
Supports LQ = CALCULATE([SupportTypeCount],DATEADD(MyTable[Date],-1,QUARTER))
Supports LQ = CALCULATE(COUNT(MyTable[Support type]),DATEADD('Date'[Date]-1,QUARTER))
Supports LQ = CALCULATE(COUNT(MyTable[Support type]),PREVIOUSQUARTER(MyTable[Date]))
Supports LQ = CALCULATE(COUNT(MyTable[Support type]),DATEADD(MyTable[Date],-1,QUARTER))

 

Any help pointing out my error will be very gratefully received!

 

CJ

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@CJDK , with help from date table marked as date table , these should work

Supports LQ = CALCULATE(COUNT(MyTable[Support type]),DATEADD('Date'[Date]-1,QUARTER))
Supports LQ = CALCULATE(COUNT(MyTable[Support type]),datesqtd(DATEADD('Date'[Date]-1,QUARTER)))

 

Make sure the date table is marked as a date table, there is no timestamp in the fact/table table

 

refer

Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw

View solution in original post

2 REPLIES 2
CJDK
Helper II
Helper II

Many thanks Amit - again! 🙏

Your video was very instructuve and I have been able to use that input and your corrections to springboard to my final measure:

QuarterlySupportChange = DIVIDE(COUNT(MyTable[Support type]), CALCULATE COUNT(MyTable[Support type]), DATEADD('Date'[Date], -1,QUARTER)),0)-1

 

Please note a missing comma in your measures:

'Date'[Date],

 

MANY thanks!

 

CJ

amitchandak
Super User
Super User

@CJDK , with help from date table marked as date table , these should work

Supports LQ = CALCULATE(COUNT(MyTable[Support type]),DATEADD('Date'[Date]-1,QUARTER))
Supports LQ = CALCULATE(COUNT(MyTable[Support type]),datesqtd(DATEADD('Date'[Date]-1,QUARTER)))

 

Make sure the date table is marked as a date table, there is no timestamp in the fact/table table

 

refer

Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw

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.