Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
HI All
I have a challenge task that required some help.
My dataset is located on the left, and my desired output logic involves marking only the first action for each product. By doing so, I can calculate the number of first actions per product.
Thank you in advance for your kind assistance. 😊
Jack
Solved! Go to Solution.
Hi ValtteriN ,thanks for the quick reply, I'll add more.
Hi @Jack_D ,
The Table data is shown below:
Please follow these steps:
1.Creating an index column in Power Query
Table.AddIndexColumn([Column],"Index",1)
2.Use the following DAX expression to create a column(The data type of the 'Index' column is number)
Column =
VAR _Product_type = [Product type1]
VAR _1st = MAXX(FILTER('Table',[Product type1] = _Product_type && [Index] = 1),[Actions])
VAR _2nd = MINX(FILTER('Table',[Product type1] = _Product_type && [Actions] <> _1st ) ,[Index])
RETURN IF([Index] >= _2nd,FALSE(),TRUE())
3.Use the following DAX expression to create a measure
Measure =
COUNTROWS(FILTER('Table',[Column] = TRUE()))
4.Final output
Best Regards,
Wenbin Zhou
Hi ValtteriN ,thanks for the quick reply, I'll add more.
Hi @Jack_D ,
The Table data is shown below:
Please follow these steps:
1.Creating an index column in Power Query
Table.AddIndexColumn([Column],"Index",1)
2.Use the following DAX expression to create a column(The data type of the 'Index' column is number)
Column =
VAR _Product_type = [Product type1]
VAR _1st = MAXX(FILTER('Table',[Product type1] = _Product_type && [Index] = 1),[Actions])
VAR _2nd = MINX(FILTER('Table',[Product type1] = _Product_type && [Actions] <> _1st ) ,[Index])
RETURN IF([Index] >= _2nd,FALSE(),TRUE())
3.Use the following DAX expression to create a measure
Measure =
COUNTROWS(FILTER('Table',[Column] = TRUE()))
4.Final output
Best Regards,
Wenbin Zhou
Hi,
This should give you the desired result:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
Thanks Valtterin
I am trying to calculated Sum of All first actions so the out put will be
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
8 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
8 |