Forum Discussion
Saffy
9 months agoNew Member
Dynamic Date Filter Toggles
i am very new to PBI, coming from a tableau background! In tableau i could use a parameter field that would have two options: include and exclude id then create an if condition, if inlcude then one...
- 6 months ago
i ended up creating the date/calendar table
then creating this calculated column Is_L5W_Exc & Is_L5W_Inc as below
Is_L5W_Exc =VAR TodayDate = TODAY()VAR StartOfCurrentWeek = TodayDate - WEEKDAY(TodayDate, 2) + 1VAR StartOfPeriod6 = StartOfCurrentWeek - 35RETURNIF(Calendar[Date] >= StartOfPeriod6 &&Calendar[Date] < StartOfCurrentWeek,TRUE(),FALSE())
then in my measures i did*Customer Count Last 5 Weeks =VAR Mode = SELECTEDVALUE('Selector - Timeframe'[Options])RETURNSWITCH(Mode,"Inc", CALCULATE(DISTINCTCOUNT('FACT_CALLS'[UniqueIdentifier]), Calendar[Is_L5W_Inc] = TRUE()),"Exc", CALCULATE(DISTINCTCOUNT('FACT_CALLS'[UniqueIdentifier]), Calendar[Is_L5W_Exc] = TRUE()),BLANK())
v-sdhruv
6 months agoCommunity Support
Hi Saffy ,
Just wanted to check if the above suggestion has addressed your query.
If you are still facing any issues you can reach out with sample data (excluding sensitive data) and share excatly where you are having difficulty so that we can assit you better.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thank You
Saffy
6 months agoNew Member
i ended up creating the date/calendar table
then creating this calculated column Is_L5W_Exc & Is_L5W_Inc as below
Is_L5W_Exc =
VAR TodayDate = TODAY()
VAR StartOfCurrentWeek = TodayDate - WEEKDAY(TodayDate, 2) + 1
VAR StartOfPeriod6 = StartOfCurrentWeek - 35
RETURN
IF(
Calendar[Date] >= StartOfPeriod6 &&
Calendar[Date] < StartOfCurrentWeek,
TRUE(),
FALSE()
)
then in my measures i did
then in my measures i did
*Customer Count Last 5 Weeks =
VAR Mode = SELECTEDVALUE('Selector - Timeframe'[Options])
RETURN
SWITCH(
Mode,
"Inc", CALCULATE(DISTINCTCOUNT('FACT_CALLS'[UniqueIdentifier]), Calendar[Is_L5W_Inc] = TRUE()),
"Exc", CALCULATE(DISTINCTCOUNT('FACT_CALLS'[UniqueIdentifier]), Calendar[Is_L5W_Exc] = TRUE()),
BLANK()
)