Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello All,
I need to calculate a variance between two fields that returns a number I can use for conditional formatting.
The scenario is, I have projects that are of different types; new install, upgrades, module etc..... Each one of these has a different metric for having the PM assigned (which is a date field in our projects table).
New installs are Project Start+84 days
Upgrades are Project Start+56 days
Modules are Project Start +42 days.
I hae the following DAX that calculates the variance but I don't know how to write so I can factor in the appropriate criteria based on the Project Type?
I know this can be done in separate measures but I'd like to keep this only one column for PM Assigned in the table while also keeping different project types in the same table.
@Clint , Not very clear. Try like
Switch( True(),
MAXX('Projects',[PMAssigned]),"Not Assigned",
DATEDIFF(MAXX('Projects',[Project Start Date]),MAXX('Projects',[CustomerReview]),DAY)>=92,2,
DATEDIFF(MAXX('Projects',[Project Start Date]),MAXX('Projects',[CustomerReview]),DAY)<=91,1,
DATEDIFF(MAXX('Projects',[Project Start Date]),MAXX('Projects',[PMAssigned]),DAY)<=84,0,
0)
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Hi Amit,
What I need the measure or calc column to do is evaluate the type of project as each Project type has different criteria. I tried using this measure - and while syntactically valid, returns the wrong results. PM Variance is a measure that returns a whole number (the difference between PM Start and PM Assigned)
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |