Forum Discussion
Need help in replicating Tableau FIXED LOD Expression
Hi Everyone,
I have employee level data for 6 quarters
My requirement is to create a table which will have list of employees in the current quarter(FY2223Q2) and their Past 3 quarter score to be displayed
My Output should be as per Table below
| Staff No. | Staff Name | Effective Quarter | Region / Territory | FY2223 Q2 Approved Score% | FY2223 Q1 Approved Score% | FY2122 Q4 Approved Score% |
| 1 | aaa | FY2223 Q2 | JP | 77% | 85% | 71% |
| 2 | bbb | FY2223 Q2 | JP | 76% | 74% | 87% |
| 3 | ccc | FY2223 Q2 | JP | 70% | 73% | 91% |
It has only staff 1,2,3. Staff 4 is not there for FY2223Q2. so he is excluded. I need to build a measure to get Q2, Q1 and Q4 score
Can anyone help please. I am not sure how to upload the data or TWBX here.
it can be achieved using Fixed LOD in Tableau. But I am not sure how to do it in POwerBI
Tableau LOD Logic :
FY2223 Q2 = {Fixed Staff No, Effective Quarter : sum(If Effective Quarter = "FY2223 Q2" then Aproved Rate end) }
FY2223 Q1 = {Fixed Staff No, Effective Quarter : sum(If Effective Quarter = "FY2223 Q1" then Aproved Rate end) }
FY2122 Q4 = {Fixed Staff No, Effective Quarter : sum(If Effective Quarter = "FY2122 Q1" then Aproved Rate end) }
My Data looks like below
| Staff No. | Staff Name | Effective Quarter | Region / Territory | Approved Score% | Approved Rate |
| 1 | aaa | FY2122 Q1 | JP | 118% | 173% |
| 1 | aaa | FY2122 Q2 | JP | 114% | 153% |
| 1 | aaa | FY2122 Q3 | JP | 100% | 100% |
| 1 | aaa | FY2122 Q4 | JP | 71% | 43% |
| 1 | aaa | FY2223 Q1 | JP | 85% | 71% |
| 1 | aaa | FY2223 Q2 | JP | 77% | 55% |
| 2 | bbb | FY2122 Q1 | JP | 102% | 105% |
| 2 | bbb | FY2122 Q2 | JP | 77% | 64% |
| 2 | bbb | FY2122 Q3 | JP | 70% | 70% |
| 2 | bbb | FY2122 Q4 | JP | 87% | 74% |
| 2 | bbb | FY2223 Q1 | JP | 74% | 48% |
| 2 | bbb | FY2223 Q2 | JP | 76% | 53% |
| 3 | ccc | FY2122 Q1 | JP | 104% | 123% |
| 3 | ccc | FY2122 Q2 | JP | 77% | 65% |
| 3 | ccc | FY2122 Q3 | JP | 67% | 67% |
| 3 | ccc | FY2122 Q4 | JP | 91% | 83% |
| 3 | ccc | FY2223 Q1 | JP | 73% | 46% |
| 3 | ccc | FY2223 Q2 | JP | 70% | 41% |
| 4 | ccc | FY2122 Q1 | JP | 108% | 123% |
| 4 | ccc | FY2122 Q2 | JP | 79% | 65% |
| 4 | ccc | FY2122 Q3 | JP | 69% | 67% |
| 4 | ccc | FY2122 Q4 | JP | 46% | 83% |
| 4 | ccc | FY2223 Q1 | JP | 71% | 46% |
Regards,
Rolin
- Anonymous3 years ago
Hi RolinMartis ,
Please try:
Q1 = CALCULATE(MAX('Table'[Approved Score%]),'Table'[Effective Quarter]="FY2223 Q1")Q2 = CALCULATE(MAX('Table'[Approved Score%]),'Table'[Effective Quarter]="FY2223 Q2")Q4 = CALCULATE(MAX('Table'[Approved Score%]),'Table'[Effective Quarter]="FY2122 Q4")Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
3 Replies
- amitchandak
Super User
RolinMartis , for fixed LOD refer:
LOD- FIXED (Level of Details): https://youtu.be/hU-cVOwDCvY
For Quarter data you can use TI
QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))
Qtr Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(ENDOFQUARTER('Date'[Date])))Last QUARTER Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD( ENDOFQUARTER(dateadd('Date'[Date],-1,QUARTER))))
Last QUARTER Sales = CALCULATE(SUM(Sales[Sales Amount]),PREVIOUSQUARTER(('Date'[Date])))Last to last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-2,QUARTER)))
Next QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],1,QUARTER)))
Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,Year)))or
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Year]="FY2223 Q2")))
- RolinMartis
Helper II
Hey amitchandak
I tried the below formulae as my quarter filed is a text field. BUt its not giving me the desired output.
Currently it is giving me the Minimum value in FY2223 Q1. BUt i also need it to pick the number for every employee.
I would need a calculation which will work at 2 columns: for every Employee its should pick me their data for a specific quarter.
I need to specify Staff number and Quarter in my condition.
- AnonymousNot applicable
Hi RolinMartis ,
Please try:
Q1 = CALCULATE(MAX('Table'[Approved Score%]),'Table'[Effective Quarter]="FY2223 Q1")Q2 = CALCULATE(MAX('Table'[Approved Score%]),'Table'[Effective Quarter]="FY2223 Q2")Q4 = CALCULATE(MAX('Table'[Approved Score%]),'Table'[Effective Quarter]="FY2122 Q4")Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum