The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi All!
I need help with calculating the number of customers based on the same number of Customer Lifetime Months. Basically, I need to create a bar chart that will show how many customers we have who stayed with us for 47, 46, etc months. Customer Lifetime Months is the measure I've created. Any help is appreciated
Solved! Go to Solution.
Hi,
I tried to create a sample pbix file like below.
One of ways to achieve this is to create an axis table something like below.
Please check the below picture and the attached pbix file.
Customers count by Lifetime measure: =
VAR _axis =
MAX ( 'Axis table'[Lifetime Measure result] )
RETURN
COUNTROWS (
FILTER (
ADDCOLUMNS (
DISTINCT ( Data[Customer] ),
"@lifetimemeasure", [Lifetime measure:]
),
[@lifetimemeasure] = _axis
)
)
Hi,
I tried to create a sample pbix file like below.
One of ways to achieve this is to create an axis table something like below.
Please check the below picture and the attached pbix file.
Customers count by Lifetime measure: =
VAR _axis =
MAX ( 'Axis table'[Lifetime Measure result] )
RETURN
COUNTROWS (
FILTER (
ADDCOLUMNS (
DISTINCT ( Data[Customer] ),
"@lifetimemeasure", [Lifetime measure:]
),
[@lifetimemeasure] = _axis
)
)
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |