March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
How do I calculate a metric which is the following for the last month.
What I have does not work:
this table 'time to conversion is connected to 'dim_date[Date]
% one session conversions =
CALCULATE(
COUNT('time_to conversion'[user_pseudo_id]),
'time_to conversion'[Session To Conversion Band] = "1"
)
/ DISTINCTCOUNT('time_to conversion'[user_pseudo_id])
Solved! Go to Solution.
Hello, @MaWrob ,
it depends on how you define last month but, if you have a calendar with some flag or just have Slicer.
you can do something like this.
% one session conversions =
CALCULATE(
CALCULATE(
COUNT('time_to conversion'[user_pseudo_id]),
'time_to conversion'[Session To Conversion Band] = "1"
)
/ DISTINCTCOUNT('time_to conversion'[user_pseudo_id]),
'calendar'[YearMonth]=MAX('calendar'[YearMonth])
)
alternatively using TOTALMTD
% one session conversions =
TOTALMTD(CALCULATE(
COUNT('time_to conversion'[user_pseudo_id]),
'time_to conversion'[Session To Conversion Band] = "1"
)
/ DISTINCTCOUNT('time_to conversion'[user_pseudo_id]), 'calendar'[Date])
or datesmtd
% one session conversions =
CALCULATE(
CALCULATE(
COUNT('time_to conversion'[user_pseudo_id]),
'time_to conversion'[Session To Conversion Band] = "1"
)
/ DISTINCTCOUNT('time_to conversion'[user_pseudo_id]),
DATESMTD('calendar'[Date]) )
Hello, @MaWrob ,
it depends on how you define last month but, if you have a calendar with some flag or just have Slicer.
you can do something like this.
% one session conversions =
CALCULATE(
CALCULATE(
COUNT('time_to conversion'[user_pseudo_id]),
'time_to conversion'[Session To Conversion Band] = "1"
)
/ DISTINCTCOUNT('time_to conversion'[user_pseudo_id]),
'calendar'[YearMonth]=MAX('calendar'[YearMonth])
)
alternatively using TOTALMTD
% one session conversions =
TOTALMTD(CALCULATE(
COUNT('time_to conversion'[user_pseudo_id]),
'time_to conversion'[Session To Conversion Band] = "1"
)
/ DISTINCTCOUNT('time_to conversion'[user_pseudo_id]), 'calendar'[Date])
or datesmtd
% one session conversions =
CALCULATE(
CALCULATE(
COUNT('time_to conversion'[user_pseudo_id]),
'time_to conversion'[Session To Conversion Band] = "1"
)
/ DISTINCTCOUNT('time_to conversion'[user_pseudo_id]),
DATESMTD('calendar'[Date]) )
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
90 | |
90 | |
85 | |
73 | |
49 |
User | Count |
---|---|
167 | |
147 | |
92 | |
70 | |
58 |