Forum Discussion
Variance in Average Pay
- 8 years ago
Hi skylarw,
Try this measure please. You can check it out in this file: https://1drv.ms/u/s!ArTqPk2pu-BkgSJ77V2S2Ik1Q7r6
Measure = VAR lastPaydate = CALCULATE ( MAX ( 'Rows 1 to 1523'[Pay Date] ), FILTER ( ALL ( 'Rows 1 to 1523' ), 'Rows 1 to 1523'[Pay Date] < MAX ( 'Rows 1 to 1523'[Pay Date] ) ) ) VAR lastGrossPay = CALCULATE ( SUM ( 'Rows 1 to 1523'[Gross Pay] ), 'Rows 1 to 1523'[Pay Date] = lastPaydate ) RETURN DIVIDE ( SUM ( 'Rows 1 to 1523'[Gross Pay] ) - lastGrossPay, lastGrossPay, 0 )Best Regards!
Dale
Thanks v-jiascu-msft but I'm not sure how I can attach a file.
I also only have an xlsx file- I'm not sure how to convert it.
Any ideas?
Hi skylarw,
You can share the file from a cloud drive like OneDrive, Google Drive, Dropbox etc. And then paste the link here.
Best Regards!
Dale
- skylarw8 years agoFrequent Visitor
Okay, awesome!
v-jiascu-msft Here's the link https://drive.google.com/open?id=0B1TLjBczsoBzdWtfb0VvZ2xLMDQ
Sorry not sure how to get it to pbix format.
- v-jiascu-msft8 years agoMicrosoft Employee
Hi skylarw,
Try this measure please. You can check it out in this file: https://1drv.ms/u/s!ArTqPk2pu-BkgSJ77V2S2Ik1Q7r6
Measure = VAR lastPaydate = CALCULATE ( MAX ( 'Rows 1 to 1523'[Pay Date] ), FILTER ( ALL ( 'Rows 1 to 1523' ), 'Rows 1 to 1523'[Pay Date] < MAX ( 'Rows 1 to 1523'[Pay Date] ) ) ) VAR lastGrossPay = CALCULATE ( SUM ( 'Rows 1 to 1523'[Gross Pay] ), 'Rows 1 to 1523'[Pay Date] = lastPaydate ) RETURN DIVIDE ( SUM ( 'Rows 1 to 1523'[Gross Pay] ) - lastGrossPay, lastGrossPay, 0 )Best Regards!
Dale
- skylarw8 years agoFrequent Visitor
v-jiascu-msft Thank you so much!
Would you be able to break it down a little in case I ever wanted to tweak it?
Also, where do you define what percentage to highlight and what color to highlight in?
Is there also a way to only show the red highlighted data? Are there other ways to show it than in a matrix?
Thank you so much it's really beautiful!
- Ashish_Mathur8 years agoSuper User
Hi skylarw,
My approach is quite similar to that of v-jiascu-msft. Since wages are paid fortnightly, here is my calculated field formula for computing the previous fortnight's wages
=CALCULATE([Total pay],DATESBETWEEN('Calendar'[Date],MIN('Calendar'[Date])-14,MIN('Calendar'[Date])-14))Total Pay is
=SUM('Rows 1 to 1523'[Gross Pay])