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.
Hi Everyone,
I am reaching out because one of the calculate I created, which includes 2 date filters, is not working.
A bit of context on what I am trying to achieve:
The company I am working for is tracking the Opportunity win and loss percentage for their opportunities and comparing the same with the previous period last year.
Now, the tricky DAX is on the calculation for the Opportunity won (they call it PO closed successfully)- the way they calculate it can be considered odd. The ask is "if I am checking all of the opportunities in Jan 2022, what was the value of those closed at the end of Jan2022 (or before) and how can I compare it with the same period last year?" - the logic for this example would look something like:
Total Opportunity: PO due date from 1st of Jan 2022 to 31st of Jan 2022
PO received: PO due date from 1st of Jan 2022 to 31st of Jan 2022 and PO received date from 1st of Jan 2020 to 31st Jan 2022
Total Opportunity Past period: PO due date from 1st of Jan 2021 to 31st of Jan 2021
PO received Past period: PO due date from 1st of Jan 2021to 31st of Jan 2021 and PO received date from 1st of Jan 2019 to 31st Jan 2021.
As you can imagine, this brings to the table 2 dates: PO due date and PO received date.
To achieve this, we will need 4 measures:
Total Opportunity current period.
PO closed successfully current period.
Total Opportunity Same period last year.
PO closed successfully Same period last year.
My problem is with the latter.
The formulas that I am using are (Notice that Date table is connected to PO due date):
Total Opportunity (working) = CALCULATE(
This last one really doesn't work, as it shows blank but I can't figure out why. What would you do?
Now, I know its not the most elegant DAX writing, and I am more than happy for any feedback - I am completely stuck!
Hi @Anonymous ,
Just keep the SAMEPERIODLASTYEAR() and remove the FILTER() syntax:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Thank you for answering!
Unfortunately, by removing the second part (Filter with PO received date intelligence), I don't get the data that I want.
However I found the solution - I created a second date table for the PO received date, which allows me contiguous dates for the SAMEPERIODLASTYEAR function on the PO received (and not only on the date).
It works, but it has some problem when it comes to more recent Years. I am still exploring possibilities.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
Check out the May 2024 Power BI update to learn about new features.
User | Count |
---|---|
92 | |
83 | |
62 | |
61 | |
58 |
User | Count |
---|---|
157 | |
118 | |
103 | |
76 | |
66 |