The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi everyone,
I have 2 tables. The first table shows start time and end time of each lot number. Another table shows information in that time periods.
I want to create a slicer of lot number so that when I select lot number, I can see information in that time periods. I can't figure out how to do that.
Does anyone know how to do this please?
Solved! Go to Solution.
Hi, @Dieu
ryan_mayu's solution is perfect.
And I would like to share some additional solutions below.
According to your description, you want to create a slicer of lot number so that when you select lot number, you can see information in that time periods?
If I understand you correctly, then you can refer to my solution.
I have extended the dataset based on some of the data you provided:
Then you can New table:
CombinedTable =
VAR LotTable = 'Table1'
VAR InfoTable = 'Table2'
RETURN
SELECTCOLUMNS (
FILTER (
CROSSJOIN ( LotTable, InfoTable ),
Table2[Sample time] >= Table1[Intake Time Start]
&& Table2[Sample time] <= Table1[Intake Time End]
),
"Lot number", Table1[Lot Number],
"Intake Time Start", Table1[Intake Time Start],
"Intake Time End", Table1[Intake Time End],
"Sample time", Table2[Sample Time],
"Information", Table2[Information]
)
Finally add a Slicer and drag Lot Number into the field to filter it:
Here is the result:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Dieu
ryan_mayu's solution is perfect.
And I would like to share some additional solutions below.
According to your description, you want to create a slicer of lot number so that when you select lot number, you can see information in that time periods?
If I understand you correctly, then you can refer to my solution.
I have extended the dataset based on some of the data you provided:
Then you can New table:
CombinedTable =
VAR LotTable = 'Table1'
VAR InfoTable = 'Table2'
RETURN
SELECTCOLUMNS (
FILTER (
CROSSJOIN ( LotTable, InfoTable ),
Table2[Sample time] >= Table1[Intake Time Start]
&& Table2[Sample time] <= Table1[Intake Time End]
),
"Lot number", Table1[Lot Number],
"Intake Time Start", Table1[Intake Time Start],
"Intake Time End", Table1[Intake Time End],
"Sample time", Table2[Sample Time],
"Information", Table2[Information]
)
Finally add a Slicer and drag Lot Number into the field to filter it:
Here is the result:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you a lot for your solution. It helps me a lot !
you can create a measure
Proud to be a Super User!
Thank you a lot for your solution
you are welcome
Proud to be a Super User!