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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Shashi_Kant82
Frequent Visitor

Slicer applied on lead stage column, calculate next stages

Hi All, 

 

I've a column with Lead statuses and their IDs, See below screenshot.

 

Shashi_Kant82_0-1679933066728.png

1. I need to add stage column as a filter and if i select any one stage then next stages count should appear, for e.g. if i select "engaged" in slicer then it should show me the count of Leads which have travelled from engaged to MQL and then Engaged to  Opportunity(Next Row) and so on.

2. Stages are not in order so i also have to sort them in correct order (Screenshot below for the order).

3. I should be able to calculate the coversion % like how many Leads converted from engaged to MQL, engaged to Opportunity and so on.

4. There is also repetetion of stages like for ID 1 we can have multiple MQL rows.

 

Shashi_Kant82_1-1679933822437.png

Kindly suggest. Thanks in advance. 

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Shashi_Kant82 ,

 

Here's my solution.

1.Create a table for the slicer with stage and sort. I created it by entering data and there's no relationship between tables. 

vstephenmsft_0-1680073890004.png

vstephenmsft_1-1680073920016.png

 

2.Create a column to get the sort number in Table.

Sort Nmuber = CALCULATE(MAX('Table for slicer'[Sort Number]),FILTER('Table for slicer',[Stage]=EARLIER('Table'[Stage])))

vstephenmsft_2-1680073971678.png

 

3.Create a measure to return countings.

Count = var _num=SELECTEDVALUE('Table for slicer'[Sort Number])+2
return CALCULATE(COUNT('Table'[ID]),FILTER(ALLSELECTED('Table'),[Sort Nmuber]=_num))

If "Engaged" is selected, the measure returns 3.

vstephenmsft_3-1680074055776.png

 

4.If you want to calculate the percentage, and then calculate the total number of IDs, you can divide them, and so on.

Percentage = var _total=CALCULATE(DISTINCTCOUNT('Table'[ID]),ALLSELECTED('Table'))
return DIVIDE([Count],_total)

vstephenmsft_4-1680074204505.png

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @Shashi_Kant82 ,

 

Here's my solution.

1.Create a table for the slicer with stage and sort. I created it by entering data and there's no relationship between tables. 

vstephenmsft_0-1680073890004.png

vstephenmsft_1-1680073920016.png

 

2.Create a column to get the sort number in Table.

Sort Nmuber = CALCULATE(MAX('Table for slicer'[Sort Number]),FILTER('Table for slicer',[Stage]=EARLIER('Table'[Stage])))

vstephenmsft_2-1680073971678.png

 

3.Create a measure to return countings.

Count = var _num=SELECTEDVALUE('Table for slicer'[Sort Number])+2
return CALCULATE(COUNT('Table'[ID]),FILTER(ALLSELECTED('Table'),[Sort Nmuber]=_num))

If "Engaged" is selected, the measure returns 3.

vstephenmsft_3-1680074055776.png

 

4.If you want to calculate the percentage, and then calculate the total number of IDs, you can divide them, and so on.

Percentage = var _total=CALCULATE(DISTINCTCOUNT('Table'[ID]),ALLSELECTED('Table'))
return DIVIDE([Count],_total)

vstephenmsft_4-1680074204505.png

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Shashi_Kant82
Frequent Visitor

guys, Please help. i am stuck here.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors