Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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.
User | Count |
---|---|
84 | |
80 | |
72 | |
71 | |
55 |
User | Count |
---|---|
108 | |
106 | |
93 | |
85 | |
67 |