The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi Guys.
Looking for some help with measures/calculated columns.
Goal is to come up with a calculation that identifies whether:
From above example, Emp2 had both grade and salary change in Feb-22, but then again, changed salary in Mar-222 but grade remained the same. Emp3 had changes all the 3 months.
Solved! Go to Solution.
@azakir , With help from a date Table
This Month Grade= CALCULATE(Max(Table[Grade]),DATESMTD('Date'[Date]))
Last Month Grade= CALCULATE(Max(Table[Grade]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
This Month Salary= CALCULATE(Max(Table[Salary]),DATESMTD('Date'[Date]))
Last Month Salary= CALCULATE(Max(Table[Salary]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
now create measures like
Changed grade
countx(values(Table[Employee]), if(not(isblank([This Month Grade])) && not(isblank([Last Month Grade])) && [This Month Grade] <> [Last Month Grade], [Employee], blank()))
Do same for salary
A modified approch above, what I discussed in this blog
@azakir , With help from a date Table
This Month Grade= CALCULATE(Max(Table[Grade]),DATESMTD('Date'[Date]))
Last Month Grade= CALCULATE(Max(Table[Grade]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
This Month Salary= CALCULATE(Max(Table[Salary]),DATESMTD('Date'[Date]))
Last Month Salary= CALCULATE(Max(Table[Salary]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
now create measures like
Changed grade
countx(values(Table[Employee]), if(not(isblank([This Month Grade])) && not(isblank([Last Month Grade])) && [This Month Grade] <> [Last Month Grade], [Employee], blank()))
Do same for salary
A modified approch above, what I discussed in this blog
Hi @amitchandak . Thanks for your help mate. This worked a charm. Double Kudos to you if I had the oppurtunity 🙂
User | Count |
---|---|
69 | |
64 | |
62 | |
55 | |
28 |
User | Count |
---|---|
203 | |
82 | |
65 | |
48 | |
38 |