Forum Discussion
Using a variable to filter data so that is show data for current month
- 3 years ago
Hi Anonymous ,
According to your description, I created a sample and here is my solution.
Please first check if the custom column you created is correct.
1, Make the following modifications according to your method 1.
VAR CurrentMonth = ADDCOLUMNS ( CALCULATETABLE ( 'Tabelle1', DATESBETWEEN ( 'Tabelle1'[Date].[Date], STARTOFMONTH ( 'Tabelle1'[Date] ), EOMONTH ( TODAY (), 0 ) ) ), "Days Range", "Current Month" ) RETURN UNION ( Next30days, Next60days, Next90days, CurrentMonth )Put “Days Range” into slicer, and you can get the final output:
2, Make the following modifications according to your method 2.
VAR CurrentMonth = ADDCOLUMNS ( CALCULATETABLE ( 'Tabelle1', 'Tabelle1'[CM] = "Current" ), "Days Range2", "Curret Month" ) RETURN UNION ( Next30days, Next60days, Next90days, CurrentMonth )Put “Days Range2” into slicer, and you can get the final output:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ xiaosunIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
According to your description, I created a sample and here is my solution.
Please first check if the custom column you created is correct.
1, Make the following modifications according to your method 1.
VAR CurrentMonth =
ADDCOLUMNS (
CALCULATETABLE (
'Tabelle1',
DATESBETWEEN (
'Tabelle1'[Date].[Date],
STARTOFMONTH ( 'Tabelle1'[Date] ),
EOMONTH ( TODAY (), 0 )
)
),
"Days Range", "Current Month"
)
RETURN
UNION ( Next30days, Next60days, Next90days, CurrentMonth )
Put “Days Range” into slicer, and you can get the final output:
2, Make the following modifications according to your method 2.
VAR CurrentMonth =
ADDCOLUMNS (
CALCULATETABLE ( 'Tabelle1', 'Tabelle1'[CM] = "Current" ),
"Days Range2", "Curret Month"
)
RETURN
UNION ( Next30days, Next60days, Next90days, CurrentMonth )
Put “Days Range2” into slicer, and you can get the final output:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ xiaosun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.