Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
CJ_96601
Helper V
Helper V

DAX Help

Hi, please refer to below tables:

 

Table 1 shows employee No (EmpNo)

Table 2 shows employee details with performance rating and year

 

Table 1 and table 2 relationship is by EmpNo

 

Filtered = Year 2020

 

 

Result is table 3

Showing employee no, performance rating (based on filtered year -1 year)

 

Regards, 

 

 

 

 

                  
         FILTER YEAR 2020      
                  
 Table 1         RESULT USING MEASURE      
  EmpNoNameGradeYEAR HIRE      EmpNoNameGradeYEAR HIREPerformance 
  1  2020      1   E 
  2  2016      2   - 
  3         3   VG 
  4         4   - 
                  
                  
                  
                  
                  
 Table 2                
  EmpNoNameGradePerformanceYear           
  1  E2019           
  1  E2018           
  1  VG2017           
  1  G2016           
  2  E2018           
  2  E2017           
  2  G2016           
  3  VG2019           
  3  E2018           
  4  POOR2020           
                  
                  
                  
4 REPLIES 4
edhans
Super User
Super User

Can you be a bit clearer on what you are trying to achieve?

  1. I don't see a Table 3 with your expected result. Create your expected result in Excel manually and paste an image of what you want it to look like, and fully explain the logic.
  2. Can you re-paste your table data using the info in the "How to provide sample data..." link below? Otherwise there is a lot of cleanup work to do for someone to help.

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Dear edhans, 

 

i have two tables:

Table 1 - data includes employee number, and other fields

Table 2  - data includes employee number, performance rating  and year when rating happened

 

Table 3 - is the result of having employee number (from table 1) and performance rating based on year filter.  Table 1 and table 2 relationship is field empno. both fields are present in Table 1 and 2.

 

 

        
        
 Table 1      
  EmpNoNameGradeYEAR HIRE  
  1  2020  
  2  2016  
  3     
  4     
        
        
        
        
        
 Table 2      
  EmpNoNameGradePerformanceYear 
  1  E2019 
  1  E2018 
  1  VG2017 
  1  G2016 
  2  E2018 
  2  E2017 
  2  G2016 
  3  VG2019 
  3  E2018 
  4  POOR2020 
        
        
        
        
RESULT WHEN FILTERED BY YEAR    
        
FILTER YEAR 2020     
        
        
 RESULT USING MEASURE      
  EmpNoNameGradeYEAR HIREPerformance 
  1   E 
  2   - 
  3   VG 
  4   - 
        
        
        
        

@CJ_96601 

You may refer to the measure below.

 

Measure =
MAXX (
    FILTER (
        Table2,
        Table2[Year]
            = SELECTEDVALUE ( 'Calendar'[Year] ) - 1
    ),
    Table2[Performance]
) & ""

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks...but it is not working...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.