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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
uda123
Frequent Visitor

Few types of attendance in the same day per employee

Hi everybody,

I have a table of employees attendance.

I want to know who entered the same entrytype or another combination of type in the same day.

For example I want an alert when an employee used "card" twice in the same day. 

what a dax formula can i use?

The table looks like this:

 

IDNAMEDATEEntryType
1Dana01/10/22card
2Dana01/10/22card
3Joe02/10/22office
4Joe02/10/22web

 

Thanks 🙂

1 ACCEPTED SOLUTION
Bifinity_75
Solution Sage
Solution Sage

Hi @uda123 , try this:

 

- In Power Query duplicate Date Column as text value:

Bifinity_75_0-1667128957509.png

- Create a custom column in Power Query to concatenate NAME & ENTRYTYPE & DATE (Text copy):

Bifinity_75_1-1667129050773.png

- Create this calculate column:

Bifinity_75_2-1667129122776.png

Count_concat =
VAR CountDistinct = Table_[CONCAT]
RETURN
CALCULATE(
    COUNTROWS(Table_),
    ALL('Table_'),
    Table_[CONCAT] = CountDistinct
)
- Go to conditional formatting select NAME as Serie:
Bifinity_75_3-1667129222032.png

 

- And apply this rule:

Bifinity_75_4-1667129265379.png

- The result is:

Bifinity_75_5-1667129313823.png

 

Best regards

 

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @uda123 ;

You could create a measure as follow:

Measure = 
var _count=CALCULATE(COUNT('Table'[EntryType]),ALLEXCEPT('Table','Table'[NAME],'Table'[DATE],'Table'[EntryType]))
return IF(_count>1,"Red","White")

then setting conditional format.

vyalanwumsft_0-1667272088750.png

The final show:

vyalanwumsft_1-1667272105780.png


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

Bifinity_75
Solution Sage
Solution Sage

Hi @uda123 , try this:

 

- In Power Query duplicate Date Column as text value:

Bifinity_75_0-1667128957509.png

- Create a custom column in Power Query to concatenate NAME & ENTRYTYPE & DATE (Text copy):

Bifinity_75_1-1667129050773.png

- Create this calculate column:

Bifinity_75_2-1667129122776.png

Count_concat =
VAR CountDistinct = Table_[CONCAT]
RETURN
CALCULATE(
    COUNTROWS(Table_),
    ALL('Table_'),
    Table_[CONCAT] = CountDistinct
)
- Go to conditional formatting select NAME as Serie:
Bifinity_75_3-1667129222032.png

 

- And apply this rule:

Bifinity_75_4-1667129265379.png

- The result is:

Bifinity_75_5-1667129313823.png

 

Best regards

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors