Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi - It's embarassing how many hours I've spent trying to figure this out.
My Data Model has a table called Project Setup with project in each row. Each project has a column called Start Date, Close Date, Total Days (close day -start date)+1, and DailyENTarget - the target is different for each project on the list.
My table has the daily target listed - this project has a target of 3288 (about 235 per day) and closes on May 11th:
The dates are based on a table/column called EnumDates[Date] which has a relationship with the other table.
I'd like the ENTargetToDate column to show the cumulative target for each day based on the target that's in the data model table and grows incrementaly each day. I have not been able to figure out how to accomplish this.
Solved! Go to Solution.
Hi @renlaforest
Here is the sample file with the solution https://we.tl/t-pHo4kYyRle
ENTargetToDate =
VAR CrrentDate = MAX ( EnumDates[Date] )
VAR FirstDateInFilter = CALCULATE ( MIN ( EnumDates[Date] ), ALLSELECTED () )
VAR NumberOfDays = DATEDIFF ( FirstDateInFilter, CrrentDate, DAY ) + 1
VAR ProjectTarget = SELECTEDVALUE ( 'ProjectSetup'[DailyENTarget] )
RETURN
ProjectTarget * NumberOfDaysHi @renlaforest
Here is the sample file with the solution https://we.tl/t-pHo4kYyRle
ENTargetToDate =
VAR CrrentDate = MAX ( EnumDates[Date] )
VAR FirstDateInFilter = CALCULATE ( MIN ( EnumDates[Date] ), ALLSELECTED () )
VAR NumberOfDays = DATEDIFF ( FirstDateInFilter, CrrentDate, DAY ) + 1
VAR ProjectTarget = SELECTEDVALUE ( 'ProjectSetup'[DailyENTarget] )
RETURN
ProjectTarget * NumberOfDaysHi @renlaforest
you may try
ENTargetToDate =
VAR CrrentDate =
MAX ( EnumDates[Date] )
RETURN
CALCULATE (
SUM ( 'ProjectSetup'[DailyENTarget] ),
ALLEXCEPT ( 'ProjectSetup', 'ProjectSetup'[ProjectName] ),
FILTER ( EnumDates, EnumDates[Date] >= CrrentDate )
)
I guess I missed something
ENTargetToDate =
VAR CrrentDate =
MAX ( EnumDates[Date] )
RETURN
CALCULATE (
SUM ( 'ProjectSetup'[DailyENTarget] ),
ALLEXCEPT ( 'ProjectSetup', 'ProjectSetup'[ProjectName] ),
REMOVEFILTERS ( EnumDates ),
FILTER ( EnumDates, EnumDates[Date] >= CrrentDate )
)
@renlaforest
Please try this just to see what results you get
ENTargetToDate =
VAR CrrentDate =
MAX ( EnumDates[Date] )
RETURN
CALCULATE (
SUM ( 'ProjectSetup'[DailyENTarget] ),
REMOVEFILTERS (),
EnumDates[Date] <= CrrentDate
)
@renlaforest
Ok Then try
ENTargetToDate =
VAR CrrentDate =
MAX ( EnumDates[Date] )
RETURN
CALCULATE (
SUM ( 'ProjectSetup'[DailyENTarget] ),
REMOVEFILTERS (),
VALUES ( EnumDates[Date] )
EnumDates[Date] <= CrrentDate
)
ENTargetToDate =
VAR CrrentDate =
MAX ( EnumDates[Date] )
RETURN
CALCULATE (
SUM ( 'ProjectSetup'[DailyENTarget] ),
REMOVEFILTERS (),
VALUES ( EnumDates[Date] ),
EnumDates[Date] <= CrrentDate
)
Hi @tamerj1 - sorry it took so long. I think this should work.
https://drive.google.com/file/d/1h24vWpK5mREvPzG1bDXkN94h_5s6qQlX/view?usp=sharing
Can you please share a sample file?
@renlaforest Basically a Running Total measure (there is a Quick Measure for this) but in column form:
ENTargetToDate column =
VAR __Project = 'Table'[Project] //assumes you have a project column in your tracking table
VAR __DailyENTarget = MAXX(FILTER('Projects',[Project] = __Project),[DailyENTarget)
VAR __Date = [Date]
VAR __Days = COUNTROWS(FILTER(ALL('Table'),[Date] <= __Date))
RETURN
__Days * __DailyENTarget
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 12 | |
| 9 | |
| 5 | |
| 5 |