Reputation: 2735
I am trying to compute the percentage of Free to Paid Sales conversions for a particular period.
Sales become paid after the threshold of 5 days. So Conversion % should exclude the last 5 days. Expected output is below.
Below are the measure I have created.
FreeSales : SUM( DATA[Free_Trials])
Conversions : SUM(DATA[Conversions])
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!
Upvotes: 0
Views: 245
Reputation: 468
You can create a calculated column with the below DAX formula.
Column2 =
VAR C = MAX ( Sheet1[Date] )
VAR RESULT =
IF (
( Sheet1[Date] ) = C,
0,
IF (
Sheet1[Date] = C - 1,
0,
IF (
Sheet1[Date] = C - 2,
0,
IF (
Sheet1[Date] = C - 3,
0,
IF (
Sheet1[Date] = C - 4,
0,
CALCULATE ( DIVIDE ( SUM ( Sheet1[Paid Sales] ), SUM ( Sheet1[Free Sales] ) ) )
)
)
)
)
)
RETURN
RESULT
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Upvotes: 1