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
Hello All,
I'm using the Matrix visual in Power BI to create a "Cohort" analysis.
As you can see below, we have the date month of the first order (first column) and then by month how many customers stayed.
The table is build in a was that we have no date intelligence. Thus I'm solely relying on min/max (but it doesn't work).
In the expected result table, you can see that I want to :
Divide(
Calculate(sum(value)),
Calculate(sum(value)),
Filtered by ? To obtain the minimum of the row.
Exemple: 80/150=53% for 201704 on the row 201701
the "201701" are number and represent the year & month.
Thank you in advance for your insights!
Best,
BT
Solved! Go to Solution.
Hi @ING_BT ,
Please refer to my pbix file to see if it helps you.
Craete a measure.
Measure =
VAR _mindate =
CALCULATE (
MIN ( 'Table'[date 2] ),
FILTER (
ALL ( 'Table' ),
'Table'[date] = SELECTEDVALUE ( 'Table'[date] )
&& 'Table'[value] <> BLANK ()
)
)
VAR mu_ =
CALCULATE (
MAX ( 'Table'[value] ),
FILTER (
ALL ( 'Table' ),
'Table'[date] = SELECTEDVALUE ( 'Table'[date] )
&& 'Table'[date 2] = _mindate
)
)
VAR zi =
MAX ( 'Table'[value] )
RETURN
DIVIDE ( zi, mu_ )
If I have misunderstood your meaning, please provide your pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Polly,
Thank you for your solution, it helps on the information I've provided !
Unfortunatly, my data set is quite differente with several dimensions&filters; so I'm working on modifiying this first and adapte your approach.
Thank you for your help!
Best,
BT
Hi @ING_BT ,
Please refer to my pbix file to see if it helps you.
Craete a measure.
Measure =
VAR _mindate =
CALCULATE (
MIN ( 'Table'[date 2] ),
FILTER (
ALL ( 'Table' ),
'Table'[date] = SELECTEDVALUE ( 'Table'[date] )
&& 'Table'[value] <> BLANK ()
)
)
VAR mu_ =
CALCULATE (
MAX ( 'Table'[value] ),
FILTER (
ALL ( 'Table' ),
'Table'[date] = SELECTEDVALUE ( 'Table'[date] )
&& 'Table'[date 2] = _mindate
)
)
VAR zi =
MAX ( 'Table'[value] )
RETURN
DIVIDE ( zi, mu_ )
If I have misunderstood your meaning, please provide your pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
76 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |