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.
Hello, I have a cumulative total from last year (2018 WAH RIDP) and data from this year (2019 YTD RIDP) graphed together. I would like to create a measure to show the difference between these two as of today. A simple difference between these two (2018-2019) includes the 2018 data for the entire year. How can I write a measure to only include current year on the last years accumulation...simply put based on my screenshot I need the following : 4550-4146 = 404.
Hi @warnera ,
You can try the following measure:
Measure = VAR _maxprdpdate = CALCULATE ( MAX ( RIDP[Date] ), ALLSELECTED ( RIDP ) ) RETURN IF ( _maxprdpdate = MAX ( 'Date Table'[Date] ), [2019 YTD RIDP] - [2018 WAH RIDP] )
If not your case, please share your sample pbix file if you don't have any Confidential Information.
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Can you clarify VAR_maxprdpdate?
That return if logic seems more like SQL?
@v-joesh-msft wrote:Hi @warnera ,
You can try the following measure:
Measure = VAR _maxprdpdate = CALCULATE ( MAX ( RIDP[Date] ), ALLSELECTED ( RIDP ) ) RETURN IF ( _maxprdpdate = MAX ( 'Date Table'[Date] ), [2019 YTD RIDP] - [2018 WAH RIDP] )If not your case, please share your sample pbix file if you don't have any Confidential Information.
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @warnera ,
Variables are a major feature that makes writing DAX code easier. It stores the result of an expression as a named variable, which can then be passed as an argument to other measure expressions.
Here are some explanations of variables and some exceptions, you can take a look:
https://docs.microsoft.com/en-us/dax/var-dax
Best Regards,
Community Support Team _ Joey
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 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |