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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
v-jiewu-msft
Community Support
Community Support

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
v-jiewu-msft
Community Support
Community Support

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.