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.
Hi All - I am pulling my hair out with overcoming this basic requirement that other BI tools have handled so well.
The requirement is that users can interact with an embedded date slicer and control which date range to display a measure for. In this case it would be 'Sales'. There is also a requirement to shows last year sales for the same date range -1 year.
So I set it up my measure being
Booked Sales = SUM(vw_fact_booking[net_total_amt])
and my date slicer works fine:
So now to do 'Year ago' - easy enough:
Booked Sales YAGO = CALCULATE(SUM(vw_fact_booking[net_total_amt]),PREVIOUSYEAR(vw_fact_booking[booking_date]))
Nope! You can see that the sales for previous year are more like this:
What am I doing wrong?
Solved! Go to Solution.
Figured it out!
Took me a while to download the 800MB model over my phone 😮
The correct DAX formula should be
Booked Sales YAGO = CALCULATE(SUM(vw_fact_booking[net_total_amt]),SAMEPERIODLASTYEAR(dates[date]))
The PREVIOUSYEAR calc was taking the whole previous year into account even if you were only selecting a month from the current year. Useful for somethings, but not for you.
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 |
---|---|
105 | |
105 | |
88 | |
73 | |
66 |
User | Count |
---|---|
124 | |
113 | |
98 | |
81 | |
72 |