March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I have the following tables(as a preview):
Table A:
ID InProgressDate SolvedDate
1 2/5/2018 2/7/2018
2 2/6/2018 2/8/2018
3 4/6/2018 4/9/2018
Table B:
Phase Start Date End Date
Phase1 2/01/2018 2/10/2018
Phase2 04/02/2018 05/10/2018
What I want is to make a visual table to see table A Columns but with another column stating in which Phase each ID situates based on InProgress or SolvedDate(If InProgressDate or SolvedDate are between Start Date & End Date :
ID InProgressDate SolvedDate Phase
1 2/5/2018 2/7/2018 Phase1
2 2/6/2018 2/8/2018 Phase1
3 4/6/2018 4/9/2018 Phase2
Can someone help me? I can't find a solution.. 😞
Thank you in advance!
Solved! Go to Solution.
I would think that your column would go something along the lines of:
Column = MAXX(FILTER(ALL('Table B'),'Table B'[Start Date]>=[InProgressDate] && 'Table B'[End Date]<=[SolvedDate]),[Phase])
You can add column to your Table A like so:
let Source = TableA, #"Added Custom" = Table.AddColumn(Source, "Custom", each Table.SelectRows(TableB, (tblB) => tblB[StartDate] <= _[InProgressDate] and tblB[EndDate] >= _[SolvedDate])), #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Phase"}, {"Phase"}) in #"Expanded Custom"
code in "Add-column"-dialogue:
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
I would think that your column would go something along the lines of:
Column = MAXX(FILTER(ALL('Table B'),'Table B'[Start Date]>=[InProgressDate] && 'Table B'[End Date]<=[SolvedDate]),[Phase])
@Greg_Deckler Any idea if I can do this from the query editor and not from DAX? Is there any method?
That would be a question for @ImkeF.
You can add column to your Table A like so:
let Source = TableA, #"Added Custom" = Table.AddColumn(Source, "Custom", each Table.SelectRows(TableB, (tblB) => tblB[StartDate] <= _[InProgressDate] and tblB[EndDate] >= _[SolvedDate])), #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Phase"}, {"Phase"}) in #"Expanded Custom"
code in "Add-column"-dialogue:
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |