Forum Discussion
Date Filter with Overlapping Preselects (Today, Yesterday, Last 7 Days, Last 30 Days, Last Month...)
mahoneypat
Okay, I get the idea and it's pretty slick. But I need a little push on the DAX side of things.
My use case is that I just need to use the calculation group items as filter option in a slicer. I have an existing calendar table which tells me what date is e.g. "yesterday", "last week", "this month", "last month" etc.
I've created my group but it "does not work" (pretty sure, you hear this quote quite often).
Here is my situation:
All the other calculation items are created in a similar fashion.
You can see that I'm using the group item in the slicer, yet the table with my performance stats does not get filtered based on my slicer selection.
I've noticed that only calculated measures (which I also have in my model) would get filtered in my table based on the selection in the slicer, not the ones which are coming straight from the raw data. In my example, the "Impr" in the table is coming straight from the raw data. It's not a "measure" created via DAX. I am just downloading data from BigQuery via Query Editor.
Any hints? 🙂
- mahoneypat3 years agoMicrosoft Employee
In your calculation item expression try using this instead
CALCULATE(SELECTEDMEASURE(), ALL('Calendar'), 'Calendar'[Last X Weeks] = "Current week")
Pat
- danzrust3 years agoHelper IV
Hi Pat,
I've gone ahead and created standalone aggregated metrics so I could use them in the calculation groups. There are some other indirect benefits of having these agg metrics ready to go anyway 🙂
Thanks for your help!