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.
I have data for which i created a measure that calculates the difference in revenue per month.
SUM (revenue)-CALCULATE(SUM(revenue),PREVIOUSMONTH (date).
All 12 months are there but what i want though is to exclude September from that calculation.
Any ideas?
Could you please provide some sample data and the desired results from that sample.
You might just need to apply a filter on your visual to exclude a specific month.
I would rather do it as a measure if possible.
So i have
Month Difference
January 50
February 20
March 75
April 50
May 10
June 15
July 20
August 25
September 10
October 15
November 25
December 25
So basically what i want is for September to be a the reset point and for the calculation of difference to start fresh. Dont know if i am explaining it clearly.
Thank you for taking the time to respond. If i didnt make myself clear please let me know and i will provide more details tomorrow
Hi @Anonymous ,
We can use the following measure to meet your requirement:
Difference = IF ( MONTH ( SELECTEDVALUE ( 'Table'[date] ) ) = 9, BLANK (), IF ( MONTH ( SELECTEDVALUE ( 'Table'[date] ) ) = 10, CALCULATE ( SUM ( 'Table'[revenue] ) ), CALCULATE ( SUM ( 'Table'[revenue] ) ) - CALCULATE ( SUM ( 'Table'[revenue] ), PREVIOUSMONTH ( 'Table'[date] ) ) ) )
If it doesn't meet your requirement, Please show the exact expected result based on the Tables that you have shared.
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey! What would the formula look like if you wanted to exclude two months? For example September and June?
Hi @Anonymous ,
How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
We can use the following measure to meet your requirement:
Difference = VAR skipMonth = { 9, 6 } RETURN IF ( MONTH ( SELECTEDVALUE ( 'Table'[date] ) ) IN skipMonth, BLANK (), IF ( MONTH ( SELECTEDVALUE ( 'Table'[date] ) ) - 1 IN skipMonth, CALCULATE ( SUM ( 'Table'[revenue] ) ), CALCULATE ( SUM ( 'Table'[revenue] ) ) - CALCULATE ( SUM ( 'Table'[revenue] ), PREVIOUSMONTH ( 'Table'[date] ) ) ) )
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
107 | |
105 | |
87 | |
61 |