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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
sunil222
Helper II
Helper II

need the dax logic

Need the dax logic when employee terminates on particular month , from that month onwards head count shows as 0 , before the terminating month shows as 1 , in this eg ravi terminates jun 23 from jun 23 onwards hc shows as 0 before that dates shows as 1

 

please give the logic for head count of emp . data is as below format

 

                                                      23-Apr    23-May   23-Jun   23-Jul   23- aug    23 -sep
emp      doj        lwd                        HC             Hc            HC         HC          HC           HC
ravi  14-0ct-21 01-jun-23                  1               1               0            0               0           0

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sunil222 ,

If I understand correctly, the issue is that you want to use the DAX formula to count of emp. Please try the following DAX formula and check if they can solve your problem:

1.Create the two simple table.

vjiewumsft_0-1707197479084.png

 

 

vjiewumsft_1-1707197493757.png

2.Create the new measure.

Measure = IF(MAX('Date table 2'[Date]) < MAX('Table'[Iwd]), 1, 0)

 

3.Select the matrix visual. Drag the emp to the Rows, drag the Date table Date to the Columns and drag the measure to the Values.

vjiewumsft_2-1707197518130.png

4.The result is shown below.

vjiewumsft_3-1707197527527.png

 

Best Regards,

Wisdom Wu

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @sunil222 ,

If I understand correctly, the issue is that you want to use the DAX formula to count of emp. Please try the following DAX formula and check if they can solve your problem:

1.Create the two simple table.

vjiewumsft_0-1707197479084.png

 

 

vjiewumsft_1-1707197493757.png

2.Create the new measure.

Measure = IF(MAX('Date table 2'[Date]) < MAX('Table'[Iwd]), 1, 0)

 

3.Select the matrix visual. Drag the emp to the Rows, drag the Date table Date to the Columns and drag the measure to the Values.

vjiewumsft_2-1707197518130.png

4.The result is shown below.

vjiewumsft_3-1707197527527.png

 

Best Regards,

Wisdom Wu

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors