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.
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'.
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
Solved! Go to Solution.
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.
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.
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])))
@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
Sorry, I don't get how to apply this in my situation..
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |