Hi
I have a fact table and a few dimensions that I created in dataverse using dataflows.
I then create a tab with a data table and drop-down filters that are nested
so this is nested if statement that I am using in the items
//if only date is sellected = default stage where other dropdowns are set to default "All"
If(Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") <> Blank() And ddTerminal_2.Selected.TerminalId = "All" And ddShift_2.Selected.Shift = "All" And ddGang_2.Selected.GangId = "All",
Filter(WorkerPlannings, TransDate = Text(DatePicker1_3.SelectedDate,"dd/mmm/yy")),
//if DATE is selected and TERMINAL is selected
Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") <> Blank() And ddTerminal_2.Selected.TerminalId <> "All" And ddShift_2.Selected.Shift = "All" And ddGang_2.Selected.GangId = "All",
Filter(WorkerPlannings, TransDate = Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") And TerminalId = ddTerminal_2.Selected.TerminalId),
//if DATE is selected and TETRMINAL is selected and SHIFT is selected
Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") <> Blank() And ddTerminal_2.Selected.TerminalId <> "All" And ddShift_2.Selected.Shift <> "All" And ddGang_2.Selected.GangId = "All",
Filter(WorkerPlannings, TransDate = Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") And TerminalId = ddTerminal_2.Selected.TerminalId And Shift = ddShift_2.Selected.Shift),
//if DATE is selecteD and TERMINAL is selected and SHIFT is selected and GANG is selected
Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") <> Blank() And ddTerminal_2.Selected.TerminalId <> "All" And ddShift_2.Selected.Shift <> "All" And ddGang_2.Selected.GangId <> "All",
Filter(WorkerPlannings, TransDate = Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") And TerminalId = ddTerminal_2.Selected.TerminalId And Shift = ddShift_2.Selected.Shift And GangId = ddGang_2.Selected.GangId),
//if DATE is selected and SHIFT is selected
Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") <> Blank() And ddTerminal_2.Selected.TerminalId = "All" And ddShift_2.Selected.Shift <> "All" And ddGang_2.Selected.GangId = "All",
Filter(WorkerPlannings, TransDate = Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") And Shift = ddShift_2.Selected.Shift),
//if DATE is selected and SHIFT is selected and GANG is selected
Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") <> Blank() And ddTerminal_2.Selected.TerminalId = "All" And ddShift_2.Selected.Shift <> "All" And ddGang_2.Selected.GangId <> "All",
Filter(WorkerPlannings, TransDate = Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") And Shift = ddShift_2.Selected.Shift And GangId = ddGang_2.Selected.GangId),
//if DATE is selected and TERMINAL is selected and GANG is selected
Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") <> Blank() And ddTerminal_2.Selected.TerminalId <> "All" And ddShift_2.Selected.Shift = "All" And ddGang_2.Selected.GangId <> "All",
Filter(WorkerPlannings, TransDate = Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") And TerminalId = ddTerminal_2.Selected.TerminalId And GangId = ddGang_2.Selected.GangId),
//if DATE is selected and GANG is selected
Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") <> Blank() And ddTerminal_2.Selected.TerminalId = "All" And ddShift_2.Selected.Shift = "All" And ddGang_2.Selected.GangId <> "All",
Filter(WorkerPlannings, TransDate = Text(DatePicker1_3.SelectedDate,"dd/mmm/yy") And GangId = ddGang_2.Selected.GangId),
//else show whole table
WorkerPlannings)
the code does what it should and all the filtering works fine but I get repetitions.. so let's say that if I apply all the filters I get 3 records but for some reason i get it repeated over and over in the data table.. anyone can point me to a direction why? and what needs to be changed ? THANX


Report
All responses (
Answers (