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
Anonymous
Not applicable

Calculating MTD, QTD, YTD, but running with circular dependency errors in DAX

Hi Guys , I am calculating YTD ,MTD, QTD, and Running Total in Power BI. However I got this error!.  any ideas? 

 

P2.jpg

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Do not loop these, have them separately

 

MTD= Totalmtd(count(Total[Member no]) , 'Date'[Date])

 

YTD= Totalytd(count(Total[Member no]) , 'Date'[Date])

Anonymous
Not applicable

Hi, It runs for the first MTD= Totalmtd(count(Total[Member no]) , 'Date'[Date]), but the when I run the YTD= Totalytd(count(Total[Member no]) , 'Date'[Date]) , the error appears and vice versa'

ZAAX_0-1649909896286.png

 

Anonymous
Not applicable

Now, I am trying to calculate like so: 

ZAAX_1-1649942787814.png

MoM =
IF(
    ISFILTERED(DimDate[Date]),
VAR __PREV_MONTH = CALCULATE(COUNT('TOTAL'[Member No]),
    DATEADD(DimDate[Date], -1, Month)
)
RETURN
Calculate(COUNTA('TOTAL'[Member No]) - __PREV_MONTH)
)

I want the value difference between months  ??

 

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.