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

Need help with Dax related to FYTD

Hi community,

 

I need help in DAX to calculate difference of current month & previous month values, but for July the value should be as it is(our Fiscal year is July to June). Following is the snapshot of the issue: 'Additional clients per month' is calculated as difference of current month 'Active Clients Cumulative' & previous month ''Active Clients Cumulative'.

Capture_july.PNG

For the month of July, I want to see July value of 'Active Clients Cumulative', not the difference from previous month value.

Following is the Dax I used:

Additional Clients per month = VAR T = CALCULATE([Active Clients FYTD],PREVIOUSMONTH(Datedim[Date]))

RETURN  IF(max(Datedim[Date])<=TODAY()+30,CALCULATE([Active Clients FYTD]-T),BLANK())

 

Please advise,

Thanks,

Meena

 

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

Hi, @Anonymous 

 

Based on your description, you may try using the following formula.

 

Additional Clients per month =
VAR T =
    CALCULATE ( [Active Clients FYTD], PREVIOUSMONTH ( Datedim[Date] ) )
RETURN
    IF (
        MAX ( Datedim[Date] )
            <= TODAY () + 30,
        IF (
            MONTH ( MAX ( DateDim[Date] ) ) = 7,
            [Active Clients FYTD],
            CALCULATE ( [Active Clients FYTD] - T )
        ),
        BLANK ()
    )

 

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, you may try using the following formula.

 

Additional Clients per month =
VAR T =
    CALCULATE ( [Active Clients FYTD], PREVIOUSMONTH ( Datedim[Date] ) )
RETURN
    IF (
        MAX ( Datedim[Date] )
            <= TODAY () + 30,
        IF (
            MONTH ( MAX ( DateDim[Date] ) ) = 7,
            [Active Clients FYTD],
            CALCULATE ( [Active Clients FYTD] - T )
        ),
        BLANK ()
    )

 

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

I think Active clients should always be cumulative?

something like this with the calendar

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(sales,sales[date] <=maxx(date,date[date])))

Cumm last month Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(sales,dateadd(sales[date],-1,month) <=maxx(date,date[date])))
Anonymous
Not applicable

@amitchandak thanks for replying but it doesnt' solve my problem. I already have cumulative active clients in the column 'Active Clients Cumulative(FYTD Jul-June). If you can tweak the DAX that I provided, it might help me resolving the issue.

You can cumulative FYTD, Only for change % make it complete cumulative. Means in change % take diff of overall cumulative - cumulative till last year

Anonymous
Not applicable

Sorry, I don't get how to apply this in my situation..

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.