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 a table of actual hours submitted to system and I would like to map the phases according to a custom table.
Example of actual hours table:
Resource Name | Date | Hours |
Resource1 | 5/1/2022 | 1 |
Resource1 | 6/30/2022 | 5 |
Resource2 | 6/30/2022 | 4 |
Example of phases table:
Start | End | Phase |
5/1/2022 | 6/15/2022 | Phase1 |
6/16/2022 | 8/31/2022 | Phase2 |
What is the most efficient approach to map these tables so in final I would see which hours belong under which phase?
Should I merge somehow the phases table to calendar table in power query? Or using DAX?
Please note that the table with actuals has 10,000+ rows, above is just a simplified example.
Thanks,
Majo
Solved! Go to Solution.
Here's a DAX solution. No relationship exists between ActualHours and Phases.
Calculated column in ActualHours:
Phase =
VAR vDate = ActualHours[Date]
VAR vTable =
FILTER ( Phases, vDate >= Phases[Start] && vDate <= Phases[End] )
VAR vResult =
MAXX ( vTable, Phases[Phase] )
RETURN
vResult
Proud to be a Super User!
Here's a DAX solution. No relationship exists between ActualHours and Phases.
Calculated column in ActualHours:
Phase =
VAR vDate = ActualHours[Date]
VAR vTable =
FILTER ( Phases, vDate >= Phases[Start] && vDate <= Phases[End] )
VAR vResult =
MAXX ( vTable, Phases[Phase] )
RETURN
vResult
Proud to be a Super User!
Hello,
as per my understanding, calculated columns are less effective than measures.
But in this case it is not possible because result is a string, or is it?
Thanks,
Majo
--------------
EDIT: Never mind, I got it quickly. 🙂
Actuals:=
VAR SumActuals = SUM(Actuals[Hours])
VAR vDate = MAX(Actuals[Date])
VAR vTable= FILTER ( Phases, vDate >= Phases[Start] && vDate <= Phases[End] )
VAR vResult = MAXX ( vTable, Phases[Phase] )
RETURN
CALCULATE(SumActuals,Phases[Phase]=vResult)
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 | |
105 | |
98 | |
65 | |
54 |