Forum Discussion
Anonymous
1 year agoNot applicable
Help with Last Quarter Formula
I calculated the sum for last quarter and last quarter previous year but they only work when I plot them against a time period. I am trying to plot it against customer name instead and the measures ...
Jihwan_Kim
Super User
1 year agoHi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I tried to use INDEX DAX function in the measure.
INDEX function (DAX) - DAX | Microsoft Learn
Latest YearQuarter Sales: =
VAR _latestquarter =
INDEX (
1,
FILTER (
ALL ( 'calendar'[Year-Quarter] ),
CALCULATE ( SUM ( sales[sales] ) ) <> BLANK ()
),
ORDERBY ( 'calendar'[Year-Quarter], DESC )
)
RETURN
CALCULATE (
SUM ( sales[sales] ),
KEEPFILTERS ( 'calendar'[Year-Quarter] = _latestquarter )
)
- Anonymous1 year agoNot applicable
Using the above gives me the error "A Circular Dependency was detected"
- Jihwan_Kim1 year ago
Super User
Hi,
Thank you for your reply, and please share your sample pbix file's link here, and then I can try to look into it.
Thank you.
- Anonymous1 year agoNot applicable
Hi Anonymous,
Please have a look at this link to resolve circular dependency
https://learn.microsoft.com/en-us/answers/questions/1095117/circular-dependency-detected-on-resource
Regards,
Vinay Pabbu