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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
PoojaG
Helper II
Helper II

Flag a user based on few data points

I am creating a power bi report based on monthly survey data. One of the question is productivity gain. I want to identify users based on following criteria:

  • Number of survey taken is greater than 2
  • reported an upward or consistent number on Productivity gained (look at the sample data)
Survey DateUser productivity
1/1/2023A30
2/1/2023A30
3/1/2023A45
4/1/2023A33
1/1/2023B30
2/1/2023B35
1/1/2023C20
2/1/2023C30
3/1/2023C40
1/1/2023D45
2/1/2023D45
4/1/2023D45

 

Expected Output 

UserFlag Super User
AN
BN
CY
DY

I tried couple of DAX formula's but the output isn't what is expected in the above sample data.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1710978914777.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1710978914777.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

this works perfectly. thank you so much. I appreciate your help

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Sahir_Maharaj
Super User
Super User

Hello @PoojaG,

 

Can you please try this:

 

1. Count Surveys per User

Survey Count = COUNTROWS('Survey')

2. Flag Users Based on Criteria

Flag Super User = 
VAR CurrentUser = 'Survey'[User]
VAR SurveyCount = CALCULATE(COUNTROWS('Survey'), FILTER('Survey', 'Survey'[User] = CurrentUser))
VAR FirstProductivity = CALCULATE(MIN('Survey'[productivity]), FILTER('Survey', 'Survey'[User] = CurrentUser), ALL('Survey'))
VAR LastProductivity = CALCULATE(MAX('Survey'[productivity]), FILTER('Survey', 'Survey'[User] = CurrentUser), ALL('Survey'))
RETURN
IF(SurveyCount > 2 && LastProductivity >= FirstProductivity, "Y", "N")

Hope this helps.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

this solution may not consider all the in between survey results. only the first and the last.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.