related table
3 TopicsCalculated column if date is within last 7 days using Calendar Dimension
I have two tables. One is a Calendar Dimension the other has values in it. They are linked by an ID, and I need to create a 'flag' to determine whether the value row is in the past 7 days, but I can't seem to get the relationship to work. I tried using USERELATIONSHIP and RELATED and RELATEDTABLE, but maybe I'm unable to get it to work. Calendar Dimension: Id Date 1 01/01/2021 2 02/01/2021 .. .. 4 20/01/2021 5 21/01/2021 Values table: Value DateID InPast7Days 500 1 0 -400 2 0 900 5 1 What i want is to use the relationship, to add the column with the 0's if the date is not within the past 7 days, and 1 if it is within the past 7 days. Hope this makes sense, and that you can help 🙂Solved8.3KViews0likes4CommentsSecond Filter criteria do not work
Hi, following DAX expression do not filter rows match second critatia i.e. Table_A[Email] not ContainString "XYZ". I can see rows conting XYZ in table. What's worng! tblFilterData = FILTER( CALCULATETABLE ( Table_A, RELATEDTABLE(Table_B) ), not (CONTAINSSTRING(Table_A[Email],"ABC") && not (CONTAINSSTRING(Table_A[Email],"XYZ")) ) Regards AtifSolved528Views0likes1CommentCalculate SUM of allocation over a related table with dynamic year filter
Hello, I am having troubles calculating the sum of Allocation from a related table, based on the year filter selection. I have the following SharePoint lists (I used Excel to simplify): tblAllocation Start_Date End_Date Year_A Allocation_in_Days Employee Project 01-01-21 31-12-21 2021 40 Anna Project 1 01-01-21 31-12-21 2021 135 Linda Project 1 01-01-22 31-12-22 2022 60 Anna Project 1 01-01-22 31-12-22 2022 95 Linda Project 1 01-01-22 31-12-22 2022 15 Hans Project 1 tblProjects Title Start Date End Date Project 1 19-10-20 30-12-22 tblTasks Title Project Start Date Due Date Cost In Days Task 1 Project 1 10-05-21 06-08-21 95 Task 2 Project 1 10-01-22 25-02-22 30 Task 3 Project 1 16-05-22 10-06-22 15 Task 4 Project 1 06-06-22 17-06-22 0 Task 5 Project 1 30-05-22 03-06-22 0 Task 6 Project 1 30-08-21 10-12-21 35 Task 7 Project 1 25-04-22 06-05-22 14 Task 8 Project 1 09-05-22 13-05-22 5 Task 9 Project 1 20-06-22 24-06-22 5 Task 10 Project 1 28-02-22 18-04-22 31 What I would like is to display in a Power BI table the following: Title (tblProjects) Start Date (tblProject) End Date (tblProjects) Cost In Days (tblTasks) Allocation_in_Days (tblAllocation) Project 1 19-10-20 30-12-22 230 345 The relationships are: -tblProjects-tblTasks: 1 to many -tblProjects-tblAllocation: 1 to many And have a filter for the tblTasks Start Date year: Whenever I select a year, the Allocation_in_Days should be calculated accordingly (example: if I select year 2021, the Allocation_in_days should be 175). That is now not the case; How can I do that? Thank you!Solved2.9KViews0likes8Comments