Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I have three columns values say GrossSalesCY, EventDate and LastYearCorrespondingDate. Now, I have to create a new column called GrossSalesLY by getting the value from GrossSalesCY where LastYearCorrespondingDate = EventDate.
Can someone please help with Dax?
Solved! Go to Solution.
Hi, @Purni55
Sorry for being so late to get back to you. Something might be missing from your Power BI Desktop. I'll send you the PBIX file, you can open it and see if there's anything wrong with the function. If you still have the above issues, I recommend that you upgrade your Power BI Desktop or reinstall it.
In PBIX, I've added a new measure, here is the DAX and preview:
GrossSalesLY Measure =
CALCULATE(
SUM('Table'[GrossSalesCY]),
FILTER(
ALL('Table'),
'Table'[LastYearCorrespondingDate] = MAX('Table'[EventDate])
)
)
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Purni55
Based on your information, I create a table:
Maybe you can create a new column and try the following DAX:
GrossSalesLY =
CALCULATE(
SUM('Table'[GrossSalesCY]),
FILTER(
ALL('Table'),
'Table'[LastYearCorrespondingDate] = EARLIER('Table'[EventDate])
)
)
Here is my preview:
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi There, Thanks for the response. Yes I am looking for the same output. I have tried your DAX but it doesn't work with calculated column and throws error Calculate is not a function.
I have tried creating a Calculated Measure instead with same DAX but doesn't satisfy the output. Can you please provide me DAX for Calculated Measure?
Thanks
Hi, @Purni55
Sorry for being so late to get back to you. Something might be missing from your Power BI Desktop. I'll send you the PBIX file, you can open it and see if there's anything wrong with the function. If you still have the above issues, I recommend that you upgrade your Power BI Desktop or reinstall it.
In PBIX, I've added a new measure, here is the DAX and preview:
GrossSalesLY Measure =
CALCULATE(
SUM('Table'[GrossSalesCY]),
FILTER(
ALL('Table'),
'Table'[LastYearCorrespondingDate] = MAX('Table'[EventDate])
)
)
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
8 | |
7 |