Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Here is the link for the live dashboard according to which I want to show.
https://public.tableau.com/profile/lintao#!/vizhome/DigitalStrategyDashboard/ClientInsight
I have used the following measures.
New active clients?
var minSelectedDate to minx (ALLSELECTED (DimDate), DimDate [Date])
return
CALCULATE (
DISTINCTCOUNT (FactDigitalStrategy [ClientKey]),
FILTER (DimDate,
DimDate [Date]>? minSelectedDate
), USERELATIONSHIP (FactDigitalclientStrategy [new Date], Dim Date [DimDigitalStrategy] ))
New Active Customers (last 24 months)
WHERE MaxFactDate?
CALCULATE (MAX (FactDigitalStrategy [Date]), ALL ('DimDate'))
VAR FDate (VAR FDate)
ENDOFMONTH ('DimDate' [Date])
VA Edate (VAR Edate)
EDATE (FDate, -24)
return
IF (
MaxFactDate < - MAX ('DimDate' [Date])
&& MaxFactDate> - Edate,
CALCULATE ([New active clients], ALL ('DimDate')) + 0
)
Active Customers (last n months) below the next part of the page of the next part of the
Was page MaxFactDate?
CALCULATE (MAX (FactDigitalStrategy [Date]), ALL ('DimDate'))
VAR FDate (VAR FDate)
ENDOFMONTH ('DimDate' [Date])
VA Edate (VAR Edate)
CALCULATE (MIN (DimDate [Date]), ALL ( 'DimDate'))
return
IF (
MaxFactDate <- MAX ('DimDate' [Date])
&& MaxFactDate> - Edate,
CALCULATE ([Active Clients], ALL ('DimDate'))
) + 0
Solved! Go to Solution.
See if this works for you (apologies since I din't apply the colour coding you have in your original):
1) To calculate the new clients by month:
New clients in month =
VAR PrevYM =
( MAX ( FactDigitalStrategy[Year] ) - 1 ) * 100
+ RIGHT ( SELECTEDVALUE ( FactDigitalStrategy[MonthYearNo] ), 2 )
VAR ActualClients =
VALUES ( FactDigitalStrategy[ClientKey] )
VAR PrevYearMonthClients =
CALCULATETABLE (
VALUES ( FactDigitalStrategy[ClientKey] ),
FILTER (
ALL ( FactDigitalStrategy ),
FactDigitalStrategy[MonthYearNo] = PrevYM
)
)
RETURN
COUNTROWS ( EXCEPT ( ActualClients, PrevYearMonthClients ) )
2) To filter the visuals based on the selection in the slicers, I created a new disconnected table for the new and active clients (and used this table for the visuals)
3) To filter the visuals, I created a measure to use in the filters for the visuals in the filter pane:
New client table (Filtered) =
IF (
SELECTEDVALUE ( '1 New client table'[MonthYearNbr] )
<= SELECTEDVALUE ( DimDate[MonthYearNbr] ),
1
)
Let us know if you need further help
I'm attachiing the sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
See if this works for you (apologies since I din't apply the colour coding you have in your original):
1) To calculate the new clients by month:
New clients in month =
VAR PrevYM =
( MAX ( FactDigitalStrategy[Year] ) - 1 ) * 100
+ RIGHT ( SELECTEDVALUE ( FactDigitalStrategy[MonthYearNo] ), 2 )
VAR ActualClients =
VALUES ( FactDigitalStrategy[ClientKey] )
VAR PrevYearMonthClients =
CALCULATETABLE (
VALUES ( FactDigitalStrategy[ClientKey] ),
FILTER (
ALL ( FactDigitalStrategy ),
FactDigitalStrategy[MonthYearNo] = PrevYM
)
)
RETURN
COUNTROWS ( EXCEPT ( ActualClients, PrevYearMonthClients ) )
2) To filter the visuals based on the selection in the slicers, I created a new disconnected table for the new and active clients (and used this table for the visuals)
3) To filter the visuals, I created a measure to use in the filters for the visuals in the filter pane:
New client table (Filtered) =
IF (
SELECTEDVALUE ( '1 New client table'[MonthYearNbr] )
<= SELECTEDVALUE ( DimDate[MonthYearNbr] ),
1
)
Let us know if you need further help
I'm attachiing the sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
Please help to write a DAX.
Sorry, I'm not understanding what you are trying to achieve with "New active clients". New compared to when?
Proud to be a Super User!
Paul on Linkedin.
@PaulDBrown i need to show the "New active clients" from the minimum date(that present in fact or dimdate table) to Max Selected date from Month or year Slicer.
For better understanding, this is the link for the live dashboard according to which I want to show.
https://public.tableau.com/profile/lintao#!/vizhome/DigitalStrategyDashboard/ClientInsight
Sorry if I'm being dense, but normally when one says "New active clients", the idea is that these are clients which are active (in the period) but were not active in another period. For example, new active clients this year vs last year (which would be clients which were not active last year).
You mention a period, but not when you consider a client to be "New" (compared to the previous month? previous year...?)
If however you are looking for clients which are active, you can use DISTINCTCOUNT
Proud to be a Super User!
Paul on Linkedin.
@PaulDBrown In my report, I have 2 types of KPI according to Client . one is "Active Clients #" and this is the distinctcount of ClientKey.
And second is "New Active Clients #" and this is New Clients.
Need to help me to calculate the "New Active Clients #" measure.
And show this "New Active Clients #" according to the live dashboard. The live dashboard link is here
https://public.tableau.com/profile/lintao#!/vizhome/DigitalStrategyDashboard/ClientInsight.
User | Count |
---|---|
84 | |
76 | |
74 | |
48 | |
39 |
User | Count |
---|---|
114 | |
56 | |
51 | |
42 | |
42 |