Forum Discussion
Anonymous
7 years agoNot applicable
FILTER DATES
Hi community, I am trying to filter by multiple date conditions. Can you please help me achieving the two conditions that I have specified within the below filters? Measure = CALCULATE...
- 7 years ago
Hi Anonymous
1.
create a calendar table
calendar = CALENDARAUTO()
2.
create relationship as below
3.
add [date] from "calendar" table
Create measures in Sheet13
Measure = COUNT(Sheet13[id]) or Measure 2 = CALCULATE(COUNT(Sheet13[id]),ALLSELECTED(Sheet13))
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
7 years agoNot applicable
Anonymous -
Another way to state your requirement is: Count Missions for the selected month and the prior months within the current quarter. Is this correct?
You will want to do the following:
1. Create a Date table that has Month, Quarter attributes, along with others.
2. Mark the Table as a Date Table
3. Create a Relationship between your date table and fact table.
4. Create a Measure like this:
Measure =
var selected_month = SELECTEDVALUE('Date'[MonthKey]) //e.g. 201902
var selected_quarter = SELECTEDVALUE('Date'[QuarterKey]) //e.g. 201901 (1st quarter 2019)
return CALCULATE(
COUNT(t_Missions[ID Mission]);
'Date'[QuarterKey] = selected_quarter;
'Date'[MonthKey] <= selected_month
)Hope this helps,
Nathan