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

Calculating Rate by Month/Overall (example data inside)

I have a series of date times. An indicator of whether the customer converted or not, every row is a customer.

Column A             Column B         Column C
2021-09-04 18:14 |Customer 1 | Converted
2021-09-05 12:13 | Customer 2 | Not Converted
 
1.1 how would i calculate the overall conversion rate and how would i put that in a plot?I figure it would be count(convertedornot)/count(totalcustomers). would i need to calculate this using dax then display it using a scorecard? what would the code/steps be based on the table above?
1.2 how do I plot conversion rate by month instead of overall? if I wanted to divide everything up by month and calculate individual conversion rates for all the months? would i need to create a new column and remove the day and time, or can i use a filter or something?
-------------------------------------------------------------------------------------------------------------
 
Column A                Column B
2021-09-04 18:14 | Direct
2021-09-05 12:13 | indirect

2.1 How would I plot the number of direct customers over time. If i wanted to do it by month would i need to create a new column with just year and month and then count the instances of "Direct" somehow in column B? what would be the steps required here as I am not sure how to do this.
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@plate201 first and foremost you need calendar table in your model and you can create one following my blog post Create a basic Date table in your data model for Time Intelligence calculations | PeryTUS IT Solutio...

 

In Transform data, change your ColumnA to date and apply the changes. set relationship between calendar table and your table on the date column.

 

Add a following measure to get converted %

 

Count Rows = COUNTROWS ( yourTable )

% Converted = 
DIVIDE ( 
CALCULATE ( [Count Rows], YourTable[ColumnC] = "Converted" ),
CALCULATE ( [Count Rows], ALLSELECTED ( YourTable[ColumnB] )
)

 

To visualize, you can use any visual, let's say it is a line chart, on the x-axis using the Month column from the Calendar table and % Converted measure on value and it will get the converted trend.

 

Start with this and then can move to others which should be pretty straightforward

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

.

 

 

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

1 REPLY 1
parry2k
Super User
Super User

@plate201 first and foremost you need calendar table in your model and you can create one following my blog post Create a basic Date table in your data model for Time Intelligence calculations | PeryTUS IT Solutio...

 

In Transform data, change your ColumnA to date and apply the changes. set relationship between calendar table and your table on the date column.

 

Add a following measure to get converted %

 

Count Rows = COUNTROWS ( yourTable )

% Converted = 
DIVIDE ( 
CALCULATE ( [Count Rows], YourTable[ColumnC] = "Converted" ),
CALCULATE ( [Count Rows], ALLSELECTED ( YourTable[ColumnB] )
)

 

To visualize, you can use any visual, let's say it is a line chart, on the x-axis using the Month column from the Calendar table and % Converted measure on value and it will get the converted trend.

 

Start with this and then can move to others which should be pretty straightforward

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

.

 

 

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.