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
neelofarshama
Post Partisan
Post Partisan

DAX for count of steps in an order

Hi,

 

I have a column steps which includes data to be counted in an order as shown below. if any one step is missed the count should not take.

     STEPS
landingpage
registration_wall
logged_in
payment_details_provided
purchase_submitted

 

Eg:

StepUser_id
landingpage1
registration_wall1
logged_in1
payment_details_provided1
purchase_submitted1
 2
landingpage2
logged_in2
payment_details_provided2
purchase_submitted2

 

Expected output: since the step chain of landing page then registration_wall  is not followed in id 2 the count should not be considered.

stepsOutput User_id Count
landingpage2
registration_wall1
logged_in1
payment_details_provided1
purchase_submitted1

 

Please help.

Thanks in Advance,

Neelofar.

1 ACCEPTED SOLUTION

Hi @neelofarshama 

 

According to your output, I modified your input[check] column, and created a [user_count] measure, here is the output, file attached.

Vera_33_0-1639017362462.png

 

View solution in original post

6 REPLIES 6
v-yetao1-msft
Community Support
Community Support

Hi @neelofarshama 

Is the result you want ?

Ailsamsft_0-1638933696902.png

I got the above result according to your data and SU's method. If this result is what you expect, then the SUs method is completely correct . Maybe you can check if there is a problem with the calculation of your check value.

If you can't find the problem, you can provide your pbix file so that we can find the cause of the problem.

 

Best Regards

Community Support Team _ Ailsa Tao

Vera_33
Resident Rockstar
Resident Rockstar

Hi @neelofarshama 

 

Since you are asking for DAX, so all did in DAX. Not sure why there is a blank step for user_id 2

Hard coded the Index column following the seq of steps, then check column

Vera_33_0-1638431540651.png

sum up check column

Vera_33_1-1638431592002.png

 

Hi @Vera_33,

 

Thank you so much for your reply I tried to implement the same logic in my report but could not get expected results. I created a index column then used check but I am getting all 0. Please help

neelofarshama_0-1638851482798.png

 

Hi @neelofarshama 

 

You are using measures in a Table visual, those two columns I created as DAX Calculated column, not measure, so they are showing like this in Table visual. What did you want to achieve?

Vera_33_0-1638922852081.png

 

Hi,

I ried the same logic but no luck below is the link to access my report, hope it helps

https://caltimes-my.sharepoint.com/:u:/g/personal/neelofer_shama_latimes_com/EW7-YOV0DTREm2473VnZEKQ...

Hi @neelofarshama 

 

According to your output, I modified your input[check] column, and created a [user_count] measure, here is the output, file attached.

Vera_33_0-1639017362462.png

 

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.