Forum Discussion
Syndicate_Admin
Administrator
4 years agoCreate the relationship between 2 tables in the data model
Good afternoon I have created a Calendar Table as follows: Calendar = where _cal = CALENDAR(MIN('Orders'[Start_Date]), MAX('Orders'[End_Date])) return ADDCOLUMNS(_cal,"Year", YEAR([Date]), "Mo...
- 4 years ago
Hello
Troubleshoot the problem. In this measure of time in the AllSELECTED function you add all the columns that you are going to show in the report.
Time Measure =WHERE SelectedTable =FILTER (ALLSELECTED ( Orders[Start Date], Orders[End Date],Orders[ID_BATCH],Orders[SIG_BY_ID] ),Pmx[End Date] <> BLANK ())WHERE CurrentStart = MAX ( Pmx[Start Date] )WHERE PreviousDatesTable = FILTER ( SelectedTable, Pmx[Start Date] < CurrentStart )WHERE PreviousEnd = MAXX ( PreviousDatesTable, Pmx[End Date] )WHERE FirstSelectedDate = MINX ( PreviousDatesTable, Pmx[CPK_SIG_TIMESTAMP] )WHERE TimeDifference = DATEDIFF ( PreviousEnd, CurrentStart, MINUTE )WHERE Result = DIVIDE ( TimeDifference, 60, " " )RETURNResultThank you for the help you have given me, thank you very much
Syndicate_Admin
Administrator
4 years agoHello again
I was already able to find it and it works.
I am very happy, thank you very much.
Syndicate_Admin
Administrator
4 years agoHello again
I have added some more columns to the order table and what is my surprise that the Time Measure is white in all rows.
Any suggestions?
- Syndicate_Admin4 years ago
Administrator
Hello
Troubleshoot the problem. In this measure of time in the AllSELECTED function you add all the columns that you are going to show in the report.
Time Measure =WHERE SelectedTable =FILTER (ALLSELECTED ( Orders[Start Date], Orders[End Date],Orders[ID_BATCH],Orders[SIG_BY_ID] ),Pmx[End Date] <> BLANK ())WHERE CurrentStart = MAX ( Pmx[Start Date] )WHERE PreviousDatesTable = FILTER ( SelectedTable, Pmx[Start Date] < CurrentStart )WHERE PreviousEnd = MAXX ( PreviousDatesTable, Pmx[End Date] )WHERE FirstSelectedDate = MINX ( PreviousDatesTable, Pmx[CPK_SIG_TIMESTAMP] )WHERE TimeDifference = DATEDIFF ( PreviousEnd, CurrentStart, MINUTE )WHERE Result = DIVIDE ( TimeDifference, 60, " " )RETURNResultThank you for the help you have given me, thank you very much