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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
baijumohan1990
Helper II
Helper II

Calculate the percentage excluding last 5 days

Hi All,

 

I am trying to compute the percentage of Free to Paid Sales conversions for a particular period. 

 

DATEFree SalesPaid SalesConv %
5/1/2021 0:0032022570%
5/2/2021 0:0028919467%
5/3/2021 0:0026715357%
5/4/2021 0:0023714260%
5/5/2021 0:0029719465%
5/6/2021 0:0030613444%
5/7/2021 0:0033013340%
5/8/2021 0:0031012039%
5/9/2021 0:002799333%
5/10/2021 0:0032011235%
5/11/2021 0:0034911132%
5/12/2021 0:0032312739%
5/13/2021 0:002628231%
5/14/2021 0:0038910126%
5/15/2021 0:0036210028%
5/16/2021 0:002857426%
5/17/2021 0:002527630%
5/18/2021 0:002607228%
5/19/2021 0:0029113145%
5/20/2021 0:002736423%

 

Sales become paid after the threshold of  5 days. So Conversion % should exclude the last 5 days. Expected output is below.

 

DATEFree SalesPaid SalesConv %
5/1/2021 0:0032022570%
5/2/2021 0:0028919467%
5/3/2021 0:0026715357%
5/4/2021 0:0023714260%
5/5/2021 0:0029719465%
5/6/2021 0:0030613444%
5/7/2021 0:0033013340%
5/8/2021 0:0031012039%
5/9/2021 0:002799333%
5/10/2021 0:0032011235%
5/11/2021 0:0034911132%
5/12/2021 0:0032312739%
5/13/2021 0:002628231%
5/14/2021 0:0038910126%
5/15/2021 0:0036210028%
5/16/2021 0:00285740%
5/17/2021 0:00252760%
5/18/2021 0:00260720%
5/19/2021 0:002911310%
5/20/2021 0:00273640%

 

Below are the measure i have created.

 

1. FreeSales      : SUM( DATA[Free_Trials])

2. Conversions : SUM(DATA[Conversions])

3. Conv  %       : Calculate ( DIVIDE( FreeSales/Conversions,0), DATESBETWEEN(DATA[DATE], STARTDATE, ENDDATE-5))

(P.S:  STARTDATE & ENDDATE are the min & max values from the date slicer)

 

Conv % is not working properly . It giving same value for all the rows in the table.  Please help to fix this issue. 

 Thanks in advance!

 

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

In an MS Excel file, can you show your formula based working to calculate SalesCon %?  Share the download link of that MS Excel file.  Also, in a card visual, you can only show one figure.  So that figure (SalesCon %) do you want to show on the card visual?  Show that clearly in the MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

i will prepare and update. thanks

ryan_mayu
Super User
Super User

@baijumohan1990 

maybe you can try this

Measure = 
VAR _maxdate=CALCULATE(max('Table'[DATE]),all('Table'))
return if(max('Table'[DATE])>_maxdate-5,0,[paidsales]/[freesales])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks. but the total is giving 0. also when i use the measure in the card visual getting 0 too. 

 

baijumohan1990_0-1622649350049.png

 

@baijumohan1990 

do you want to display the result in a card visual or a table? What's the expected output for a card visual?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I need this to be shown in both table and card visual. In card visual it will show the averge conversion % value. 

@baijumohan1990 

maybe you can create another measure

measure2=averagex(table, measure)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.