Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi I would like this formula for a column to count all provider names that have an application sum of 0 between 7/1/17-7/31/17.
If the sum is zero I would like to put a label that provider name saying "lapse" . Once I have this baseline, the goal is to create formulas on top of this to show whether they've lapsed for 1, 2, 3 months, etc.
How can I do this?
CALCULATE ( counta ( LNApps_ProviderDim[Provider_Name] ), 'LNApps_Facts'[Total_Application_Amt] =0,DATESBETWEEN(LNApps_AppDateDim[ActualDate], DATE(2017,7,1), DATE(2017,7,30)))
Solved! Go to Solution.
@Anonymous
If you need to have your calculation group by ID and date, you can add ALLEXCEPT() into your CALCULATE().
= CALCULATE ( SUM ( LNApps_Facts[Application_Count] ), DATESBETWEEN ( LNApps_AppDateDim[ActualDate], DATE ( 2017, 8, 1 ), DATE ( 2017, 8, 31 ) ), ALLEXCEPT ( LNApps_Facts, LNApps_Facts[ID], LNApps_Facts[Date] ) )
Regards,
IF(CALCULATE ( counta ( LNApps_ProviderDim[Provider_Name] ), 'LNApps_Facts'[Total_Application_Amt] =0,DATESBETWEEN(LNApps_AppDateDim[ActualDate], DATE(2017,7,1), DATE(2017,7,30)))=0,"Lapse","Not Lapse")
?
Thanks for your response. I receive this error: A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed
Try doing your CALCULATE as a VAR and then your IF as a RETURN using your variable.
VAR m = CALCULATE(.....)
RETURN (IF(m=0...)
Something like that maybe.
Thanks, I'll see if I can get that to work. I think I may need to try a different approach due to the way I want to build this out.
CALCULATE(SUM(LNApps_Facts[Application_Count]), DATESBETWEEN(LNApps_AppDateDim[ActualDate], DATE(2017,8,1), DATE(2017,8,31) ))
How can I use this formula but just sum by an ID?
If you create a Calendar Table(with Dates), and relate it to your "Fact Table" Date, you could ...
IF(
ISBLANK(
CALCULATE(
DISTINCTCOUNT(LNApps_ProviderDim[Provider_Name]),
FILTER(
ALL(Calendar),
Calendar[Date] <= MAX(Calendar[Date]) &&
Calendar[Date] >= MIN (Calendar[Date])
)
)
),
"Lapse",
"Not Lapse"
)
Then you can use the same formula for every filter
Thanks vcastello, I don't think I understand the formula, there's no summation in there. I want to avoid creating other tables because that tends to get hairy pretty fast for me. If I could just figure out how to sum the app count by ID and by date I think I will be okay. See below
.
CALCULATE(SUM(LNApps_Facts[Application_Count]), DATESBETWEEN(LNApps_AppDateDim[ActualDate], DATE(2017,8,1), DATE(2017,8,31) ))
@Anonymous
If you need to have your calculation group by ID and date, you can add ALLEXCEPT() into your CALCULATE().
= CALCULATE ( SUM ( LNApps_Facts[Application_Count] ), DATESBETWEEN ( LNApps_AppDateDim[ActualDate], DATE ( 2017, 8, 1 ), DATE ( 2017, 8, 31 ) ), ALLEXCEPT ( LNApps_Facts, LNApps_Facts[ID], LNApps_Facts[Date] ) )
Regards,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
78 | |
65 | |
53 |
User | Count |
---|---|
144 | |
103 | |
98 | |
85 | |
64 |