Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Our financial year start from July to June. I want a cummlative sum that resets every financial year. I went through almost all the threads here and tried the formulas with no luck. Here is my DAX code:
Solved! Go to Solution.
Hi @shantanugupta ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Create a calculated column as below to get the financial year
Financial Year =
IF (
MONTH ( 'v_Usage'[UsageDate] ) >= 7,
YEAR ( 'v_Usage'[UsageDate] ) & "-"
& YEAR ( 'v_Usage'[UsageDate] ) + 1,
YEAR ( 'v_Usage'[UsageDate] ) - 1 & "-"
& YEAR ( 'v_Usage'[UsageDate] )
)
2. Create a measure as below to get the culmulative values by financial year
Measure =
CALCULATE (
SUM ( v_Usage[Used] ),
FILTER (
ALLSELECTED ( v_Usage ),
v_Usage[UsageDate] <= MAX ( v_Usage[UsageDate] )
&& v_Usage[Financial Year] = SELECTEDVALUE ( v_Usage[Financial Year] )
)
)
Best Regards
Hi @shantanugupta ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Create a calculated column as below to get the financial year
Financial Year =
IF (
MONTH ( 'v_Usage'[UsageDate] ) >= 7,
YEAR ( 'v_Usage'[UsageDate] ) & "-"
& YEAR ( 'v_Usage'[UsageDate] ) + 1,
YEAR ( 'v_Usage'[UsageDate] ) - 1 & "-"
& YEAR ( 'v_Usage'[UsageDate] )
)
2. Create a measure as below to get the culmulative values by financial year
Measure =
CALCULATE (
SUM ( v_Usage[Used] ),
FILTER (
ALLSELECTED ( v_Usage ),
v_Usage[UsageDate] <= MAX ( v_Usage[UsageDate] )
&& v_Usage[Financial Year] = SELECTEDVALUE ( v_Usage[Financial Year] )
)
)
Best Regards
@shantanugupta ,with help from a date table and time intelligence
YTD Sales = CALCULATE(SUM ( v_Usage[Used] ),DATESYTD('Date'[Date],"6/30"))
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
User | Count |
---|---|
102 | |
91 | |
87 | |
79 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
75 | |
64 |