Forum Discussion
Group by Data Ranges
- 10 years ago
Elliott First you need a table with the text that you need on the slicer with also a column for sorting and getting the value.
Use "Enter Data" to create a table
Period Sort Today's Data 1 Last 7 Days 2 Last 30 Days 3
The table won't have any relantionship with others ( let's call it "Periods")
Create a new measure that will change based on the slicer selection
VariablePeriod = SWITCH ( MIN ( Periods[Sort] ); 1; CALCULATE ( [yourmeasure]; FILTER ( Table; Table[Days Aging] = 1 ) ); 2; CALCULATE ( [yourmeasure]; FILTER ( Table; Table[Days Aging] > 1 && Table[Days Aging] <= 7 ) ); 3; CALCULATE ( [yourmeasure]; FILTER ( Table; Table[Days Aging] > 30 ) ) )Now add as slicer the Periods field from "Periods Table" and use the [VariablePeriods] for your graphs.
Notice that if there is no selection on the slicer it will calculate the MIN( Periods[Sort]) which is Today's. You can use MAX if you want to show all data.
*I am writing without pbix open, so maybe some mispelling on formula.
* If you go to powerpivotpro.com and search " disconnected slicer" there are many and great posts on the subject
Elliott First you need a table with the text that you need on the slicer with also a column for sorting and getting the value.
Use "Enter Data" to create a table
Period Sort Today's Data 1 Last 7 Days 2 Last 30 Days 3
The table won't have any relantionship with others ( let's call it "Periods")
Create a new measure that will change based on the slicer selection
VariablePeriod =
SWITCH (
MIN ( Periods[Sort] );
1; CALCULATE ( [yourmeasure]; FILTER ( Table; Table[Days Aging] = 1 ) );
2; CALCULATE (
[yourmeasure];
FILTER ( Table; Table[Days Aging] > 1 && Table[Days Aging] <= 7 )
);
3; CALCULATE ( [yourmeasure]; FILTER ( Table; Table[Days Aging] > 30 ) )
)Now add as slicer the Periods field from "Periods Table" and use the [VariablePeriods] for your graphs.
Notice that if there is no selection on the slicer it will calculate the MIN( Periods[Sort]) which is Today's. You can use MAX if you want to show all data.
*I am writing without pbix open, so maybe some mispelling on formula.
* If you go to powerpivotpro.com and search " disconnected slicer" there are many and great posts on the subject
- Anonymous10 years agoNot applicable
What does [yourmeasure] refer to in your comment? I am very new to DAX, so not sure about the syntax.
- konstantinos10 years ago
Memorable Member
the name of your measure - replace it with your calculation.
i.e [Sales] or [Total Clients] etc.
- Anonymous10 years agoNot applicable
Actually I have around 5 values in the slicer and I need to group them into 3 categories and display these 3 categories as the new values of the slicer. Is that possible using this?