Forum Discussion
nogi
8 years agoAdvocate II
Calculating true variance
I have a logic in my head which I am trying to work out the best way to implement using Power BI. I want to show variance (in days) for tasks using the following rules: Closed - Actual Finish - Bas...
- 8 years ago
For the moment, I have a calculate filed in project that gives me the value required:
IIf([% Complete]<100,IIf([Finish]>now(),DateDiff("d",[Baseline Finish],[Finish]),DateDiff("d",[Baseline Finish],now())),DateDiff("d",[Actual Finish],[Baseline Finish])) - 8 years ago
I played around some more and have found it easier to do the same with DAX:
Column: CheckVariance = IF(ISBLANK('Tasks'[TaskActualFinishDate].[Date]), IF(TODAY()>'Tasks'[TaskFinishDate].[Date],TODAY()-'Tasks'[BaselineFinishDate].[Date], 'Tasks'[TaskFinishDate].[Date] - 'Tasks'[BaselineFinishDate].[Date]), 'Tasks'[TaskActualFinishDate].[Date] - 'Tasks'[BaselineFinishDate].[Date])Now, what if I only wanted to know the business days and exclude weekends from the count?
v-jiascu-msft
8 years agoMicrosoft Employee
Hi nogi,
1. You need to import all the data into Power BI Desktop;
2. It seems you want to group the data by rules. Then you can add a calculated column with "Closed", "Current" and "Future".
3. Use the build-in functions. Maybe it looks like this:
varPopulation = VAR.P ( Sales[Quantity] )
The reports could be:
Rules varPopulation
Closed 0.88
Current 1.66
Future 2.1
If you have more questions, please provide your .pbix file.
Best Regards!
Dale