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
Anonymous
Not applicable

How to make row with DAX to grouping person

hi, I'm a little confused to make a column that determines what group he belongs to someone (Compliance and not Compliance)

for the data as in Excel

so the conditions to enter into groups which are as follows:
1. when a person fills a time sheet for 1 day then he enters the Compliance category (you can see from status)
2. when a person does not fill in a time sheet 1 day (even if it's only 1 day) then he automatically enters the not compliance category

for excel I've made an example that I want
messageImage_1580264203521.jpg
note

1= they fill the timesheet on that day
0= empty or they not fill the timesheet on that day

 


and data in my PowerBI just like this
note

timesheet on excel is IsComplete row on power bi

false = 0
true= 1

 

messageImage_1580264192700.jpg*i give the real data in excel*

and i want to show in power bi like this
so the visual will show how many person on january not compliance and compliance by LeadName

messageImage_1580264173033.jpg

thank you

 

 

Best Regards,

Faishal Abdillah

1 ACCEPTED SOLUTION

Move earlier inside and try

if(
sumx(filter(table,table[name] = earlier(table[name]) && format(table[Date],"YYYY-MM")<=format(earlier(table[Date]),"YYYY-MM")),table[time sheet])
< countx(filter(table,table[name] = earlier(table[name]) && format(table[Date],"YYYY-MM")<=format(earlier(table[Date]),"YYYY-MM")),table[time sheet])
,"Not Compliance","Compliance")

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

Create a new column like

 

if(
sumx(filter(table,table[name] = earlier(table[name]) && format(table[Date],"YYYY-MM")=earlier(format(table[Date],"YYYY-MM"))),table[time sheet])
< countx(filter(table,table[name] = earlier(table[name]) && format(table[Date],"YYYY-MM")=earlier(format(table[Date],"YYYY-MM"))),table[time sheet])
,"Not Compliance","Compliance")

 

you might have to change filters as per need.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Anonymous
Not applicable

@amitchandak,

 

i got an error in here

 

@Anonymous 

Not sure added some screenshot or pasted some error, not visible to me

Anonymous
Not applicable

@amitchandak,

 

ah sorry asdasdada.png

 

Move earlier inside and try

if(
sumx(filter(table,table[name] = earlier(table[name]) && format(table[Date],"YYYY-MM")<=format(earlier(table[Date]),"YYYY-MM")),table[time sheet])
< countx(filter(table,table[name] = earlier(table[name]) && format(table[Date],"YYYY-MM")<=format(earlier(table[Date]),"YYYY-MM")),table[time sheet])
,"Not Compliance","Compliance")

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.