Forum Discussion
Filtering and grouping by bucket
- Anonymous1 year ago
Hi Jtbonner1986
Sorry for misunderstanding you, thanks for your explanation. You don't need to show "Nothing" value in the expected result, right?
I hope the following test can help you.
1. Execute "Unpivoted Columns" in Transform data (Power Query)
Select the Material and Months Cover columns, then Transform -> Unpivoted columns -> Unpivoted other columns
Close & Apply
2. Create a calculated table
Slicer = VALUES('Table'[Months Cover])no relationship between two tables
3. Create a measure
Measure = VAR _selected = SELECTEDVALUE(Slicer[Months Cover]) RETURN IF(MAX('Table'[Months Cover]) <= _selected && LEFT(MAX('Table'[Attribute])) = LEFT(_selected) && MAX('Table'[Value]) <> "Nothing", 1, 0)Output:
If you need to display all values when no slicer is selected, you can modify the measure:
Measure = VAR _selected = SELECTEDVALUE(Slicer[Months Cover]) RETURN IF(_selected = BLANK(), 1, IF(MAX('Table'[Months Cover]) <= _selected && LEFT(MAX('Table'[Attribute])) = LEFT(_selected) && MAX('Table'[Value]) <> "Nothing", 1, 0))Output:
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Julia,
in the example given if 1M weas selected, you should only filter the materials with 1M or less, so it should only show, material 123.
if filtering 3M cover, it should show material 123 & 456....
Hi Jtbonner1986
Sorry for misunderstanding you, thanks for your explanation. You don't need to show "Nothing" value in the expected result, right?
I hope the following test can help you.
1. Execute "Unpivoted Columns" in Transform data (Power Query)
Select the Material and Months Cover columns, then Transform -> Unpivoted columns -> Unpivoted other columns
Close & Apply
2. Create a calculated table
Slicer = VALUES('Table'[Months Cover])
no relationship between two tables
3. Create a measure
Measure =
VAR _selected = SELECTEDVALUE(Slicer[Months Cover])
RETURN
IF(MAX('Table'[Months Cover]) <= _selected && LEFT(MAX('Table'[Attribute])) = LEFT(_selected) && MAX('Table'[Value]) <> "Nothing", 1, 0)
Output:
If you need to display all values when no slicer is selected, you can modify the measure:
Measure =
VAR _selected = SELECTEDVALUE(Slicer[Months Cover])
RETURN
IF(_selected = BLANK(), 1, IF(MAX('Table'[Months Cover]) <= _selected && LEFT(MAX('Table'[Attribute])) = LEFT(_selected) && MAX('Table'[Value]) <> "Nothing", 1, 0))
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.