Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Good Day
I have the below TABLE with 3 Columns --> Project, Activity & Date.
Query 1: Calculate the duration for each activity from Milestone 1 per Project. See RESULT Column
Query 2: I will need to work out a way for a user to select two different milestones from probably 2 x Drop Down Lists i.e. Select Milestone Option 1 & Milestone Option 2 - but it should calculate the duration between those milestones.
Cheers!!
Solved! Go to Solution.
Hi @hackfifi ,
Here I create one sample for your reference.
Q1: To create a calculated column as below.
Column = VAR M1date = CALCULATE ( MAX ( 'Table1'[Date] ), FILTER ( ALLEXCEPT ( Table1, Table1[Project] ), Table1[activity] = "M1" ) ) RETURN DATEDIFF ( M1date, 'Table1'[Date], DAY )
Q2:
1. Create two calculated table.
between1 = DISTINCT(Table1[activity])
between2 = DISTINCT(Table1[activity])
2. Create a meausre to get the reuslt we need.
Measure = VAR startdate = CALCULATE ( MAX ( 'Table1'[Date] ), FILTER ( ALLEXCEPT ( Table1, Table1[Project] ), Table1[activity] = SELECTEDVALUE ( between1[From] ) ) ) VAR todate = CALCULATE ( MAX ( 'Table1'[Date] ), FILTER ( ALLEXCEPT ( Table1, Table1[Project] ), Table1[activity] = SELECTEDVALUE ( between2[To] ) ) ) RETURN DATEDIFF ( startdate, todate, DAY )
For more details, please check the pbix as attached.
Regards,
Frank
Hi @hackfifi ,
To use a new measure to work on it.
Measure 2 = VAR startdate = CALCULATE ( MAX ( 'Table1'[Date] ), FILTER ( ALL ( Table1 ), Table1[Project] = SELECTEDVALUE ( Projects[Project] ) && Table1[activity] = SELECTEDVALUE ( between1[From] ) ) ) VAR todate = CALCULATE ( MAX ( 'Table1'[Date] ), FILTER ( ALL ( Table1 ), Table1[Project] = SELECTEDVALUE ( Projects[Project] ) && Table1[activity] = SELECTEDVALUE ( between2[To] ) ) ) RETURN DATEDIFF ( startdate, todate, DAY )
Regards,
Frank
Hi @hackfifi ,
Here I create one sample for your reference.
Q1: To create a calculated column as below.
Column = VAR M1date = CALCULATE ( MAX ( 'Table1'[Date] ), FILTER ( ALLEXCEPT ( Table1, Table1[Project] ), Table1[activity] = "M1" ) ) RETURN DATEDIFF ( M1date, 'Table1'[Date], DAY )
Q2:
1. Create two calculated table.
between1 = DISTINCT(Table1[activity])
between2 = DISTINCT(Table1[activity])
2. Create a meausre to get the reuslt we need.
Measure = VAR startdate = CALCULATE ( MAX ( 'Table1'[Date] ), FILTER ( ALLEXCEPT ( Table1, Table1[Project] ), Table1[activity] = SELECTEDVALUE ( between1[From] ) ) ) VAR todate = CALCULATE ( MAX ( 'Table1'[Date] ), FILTER ( ALLEXCEPT ( Table1, Table1[Project] ), Table1[activity] = SELECTEDVALUE ( between2[To] ) ) ) RETURN DATEDIFF ( startdate, todate, DAY )
For more details, please check the pbix as attached.
Regards,
Frank
@v-frfei-msft - another query.
so i actually have a MASTER "Project" table. In this case a table "Project" with a,b,c
but even if i create a relationship between Table "Project" & Table1, the filter do not seem to work. Any workaround for this?
i would attach the below PBIX file, but i am not exactly sure how to!
Hi @hackfifi ,
Please upload your files to OneDrive and share the link here.
Regards,
Frank
Hi @hackfifi ,
To use a new measure to work on it.
Measure 2 = VAR startdate = CALCULATE ( MAX ( 'Table1'[Date] ), FILTER ( ALL ( Table1 ), Table1[Project] = SELECTEDVALUE ( Projects[Project] ) && Table1[activity] = SELECTEDVALUE ( between1[From] ) ) ) VAR todate = CALCULATE ( MAX ( 'Table1'[Date] ), FILTER ( ALL ( Table1 ), Table1[Project] = SELECTEDVALUE ( Projects[Project] ) && Table1[activity] = SELECTEDVALUE ( between2[To] ) ) ) RETURN DATEDIFF ( startdate, todate, DAY )
Regards,
Frank
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
89 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |