Forum Discussion
Value between two columns
- 5 years ago
Hi Anonymous
EDIT: Forgot the attachment - just attached it!
Thanks for testing this out!
After looking at your overall requirements, I think this is a good candidate for a Calculation Group, with a Calculation Item that applies the range filter to the parts .
When the Calculation Item is applied as a filter, the "range" filter will be applied to any measures used in the visuals.
I have attached an updated PBIX, with a PartChild table added (hopefully similar to yours).
1. The first thing I did was create a Calculation Group called Parts Filter, with a single column Parts Filter, with a Calculation Item Parts in Range. This Calculation Item is defined as
VAR MinValue = MIN ( Range[Value] ) VAR MaxValue = MAX ( Range[Value] ) RETURN CALCULATE ( SELECTEDMEASURE (), 'Product'[FROM] <= MaxValue, 'Product'[THROUGH] >= MinValue )If you haven't created Calculation Groups before, you'll need Tabular Editor. See here for example.
2. Next I applied a Page filter, selecting Parts Filter = "Parts in Range".
3. Then I ensured that all visuals use explicit measures, namely:
Part Count = COUNTROWS ( 'Product' ) Child Count = COUNTROWS ( PartChild )4. The above measures work fine on cards/pie charts. However table visuals with no measures displayed need a have a measure injected somehow. I chose to apply a visual level filter of Part Count is not blank to the table visuals, which is modified by the Calculation Gruop.
What do you think of this method? I think it simplifies applying the range filter and saves writing multiple measures with the same filter.
Regards,
Owen
You don't need to I guess. You can simply use the other table's single column and the you can choose your own from and to values directly from the slicer.
- Anonymous5 years agoNot applicable
Sorry, still being dense here. I don't understand how to "use the other table's single column"
Assume this simplistic table structure:
Putting slicers simply on the FROM and THROUGH values does not yield what I need.
Do I build a relationship between the two tables?I have tried using the <= and >= options on separate slicers and configured them either way and it does not return all the rows that overlap the specified range.
A single slicer on either column won't do it either. If I put in 10 as in input value I would want to see rows that have 10 anywhere between the FROM and THROUGH.
Thanks for your responses.