Forum Discussion
Using SUMX() to Count Values within Varying Periods (Quarters and Years)
- 9 years ago
Hi Anonymous,
Try this formula
=COUNTROWS(FILTER(SUMMARIZE(FILTER(FBChecks,FBChecks[check_member_type]="Comprehensive"||FBChecks[check_member_type]="Social"),FBChecks[member_id],"ABCD",SUM(FBChecks[amount])),[ABCD]>90))
Hope this helps.
Hi Anonymous,
Try this formula
=COUNTROWS(FILTER(SUMMARIZE(FILTER(FBChecks,FBChecks[check_member_type]="Comprehensive"||FBChecks[check_member_type]="Social"),FBChecks[member_id],"ABCD",SUM(FBChecks[amount])),[ABCD]>90))
Hope this helps.
Thanks so much Ashish_Mathur – this got the exact results I needed.
I did stumble across the SUMMARIZE() function in my google-fu, but was struggling with how to reference a specific column from within the summarized table.
I see that you simply used a name that was not used in any of the original tables (e.g. "ABCD") and then were able to simply reference it using [ABCD] in the filter function (e.g. [ABCD] > 90).
I know ideally the suggestions I've read are to always precede a column name with its table name (e.g. Table[Column]) and to not precede measure names (e.g. [Measure]); that way one can immediately tell what's being referenced when reviewing DAX code.
Is there a way to continue to use those best practice suggestions while referencing columns from within a summarized table? Can you give a summarized table a name? Or is the summarized table only really used to pass to other functions that accept tables? Curious as to your insight here.
Thanks again.
Ashish_Mathur wrote:Hi Anonymous,
Try this formula
=COUNTROWS(FILTER(SUMMARIZE(FILTER(FBChecks,FBChecks[check_member_type]="Comprehensive"||FBChecks[check_member_type]="Social"),FBChecks[member_id],"ABCD",SUM(FBChecks[amount])),[ABCD]>90))Hope this helps.
- Ashish_Mathur9 years ago
Super User
Hi,
You are welcome. I do not know whether a summarised table can be given a name or not. May be someone else can help here.