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
Luk92
New Member

DAX - first occurs from a group of values and counting them

Hi all,

I'm pretty new to DAX and Power BI and I've got a probem that I need to resolve. I'm trying to get 2 things from one table.
 Table, lets call it Tab1, looks like this:

Luk92_0-1694607892089.png


I would like to create a measure to:
1. Check the earliest date when status1, status2 or status3 occurs 
2. Count when one of those values (status1, status2 or status3) occurs

It should look like that:

Luk92_1-1694608085519.png

 

Could you help me? 🙂

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

Cnt Status.pbix

 

ThxAlot_0-1694613310499.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

3 REPLIES 3
ThxAlot
Super User
Super User

Cnt Status.pbix

 

ThxAlot_0-1694613310499.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Hi,

thanks for the solution 🙂 I have to admit that I've made a mistake when showing how I would like the resault table to look like. It's a small change, maybe you could help. I just don't want the ID 4 show in that table at all, because it dosen't have status that I want to count.

Luk92_0-1694615054131.png



EDIT: Ok, I've got it 🙂 Just changed "0" in RETURN to BLANK().

A small tweak does the trick

ThxAlot_0-1694628203487.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



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.