Forum Discussion
Creating a Measure to Compare Aggregated Values Across Different Date Filters
- 1 year ago
Hi Anonymous,
Thank you for reaching out to the Microsoft fabric community forum. Also thanks burakkaragoz, tharunkumarRTK, for those valuable insights for this thread.
After thoroughly reviewing the details you provided, I reproduced the scenario again, and it worked on my end. I used it as sample data and successfully implemented it.
outcome:
I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
Anonymous
To handle such scenarios, you can create one date table and create one active and multiple inactive relationships between the date dimension and fact table.
In your DAX measures, if you want to calculate based on active filter then you do not to modify the context, it is required only when you want to calcualte based on inactive relationship, for example:
Orders = COUNTROWS(Sales)
Orders Shipped =
CALCULATE(
COUNTROWS(Sales)
,USERELATIONSHIP('Date'[Date], Sales[ShipDate])
)
If you want to create. a third measure, then you can do it easily
Difference = [Orders] - [Orders Shipped]
follow this documet for more details
https://learn.microsoft.com/en-us/power-bi/guidance/relationships-active-inactive
Connect on LinkedIn
|