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
Hi Anonymous ,
You can achieve this by using a single column where you have values from 1 to max range. Then use that column in a slicer and use the option "Between" from the downward arrow in top right, as shown below:
Thanks,
Dheeraj
If this post helps, then please consider Accept it as the solution and give thumbs up to help the other members find it more quickly.
Thanks, but I don't really understand how to put the pieces together. I do have another table that has a single column I can leverage but I can't connect this table to it with both the FROM and THROUGH values since that would be multiple relationships.