Forum Discussion
Anonymous
6 years agoNot applicable
slicer to split data in half
I have a single table source. This table has a Date attribute. This Date spans a 6-month range. I have created a derived column in my PBI data model to identify if the given date is in the first h...
danextian
6 years agoSuper User
Hi Anonymous,
Without a sample data, I can only imagine how it looks.
There are many ways to achieve your requirement and this just one.
- Create this calculated column in your table which will return the month order starting from the earliest date.
Rolling Month Number =
DATEDIFF (
CALCULATE ( MIN ( 'Table'[Date] ), ALL ( 'Table' ) ),
'Table'[Date],
MONTH
) + 1 Range =
DATATABLE (
"Range", STRING,
"MaxMonth", INTEGER,
{
{ "first 3 months", 3 },
{ "all six months", 6 }
}
)
Use this measure to as a visual filter. From the filters pane, select is not blank.
RowCount =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( 'Table', 'Table'[Rolling Month Number] <= MAX ( Range[MaxMonth] ) )
)