Forum Discussion
Date Year Functions in DAX Issue
- Anonymous3 years ago
Hi jayasurya_prud ,
Are table and table the same table? There is no [no of grad] in the sample data, and I try to make you understand how to dynamically group calculations.
Since you want dynamic results. If it's a calculated column, please try
year column = var counts = CALCULATE(COUNTROWS('Table'),FILTER('Table',[Year_String]=MAX('Table'[Year_String]))) var grads_attr =CALCULATE(COUNTROWS('Table'),FILTER('Table',[no of years] = 1&&[Not Active]<>"Yes"&&[Year_String] =MAX('Table'[Year_String]))) return counts - grads_attrIf it's a measure, please try
year measure = var counts = CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),[Year_String]=MAX('Table'[Year_String]))) var grads_attr =CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),[no of years] = 1&&[Not Active]<>"Yes"&&[Year_String] =MAX('Table'[Year_String]))) return counts-grads_attrWe often use FILTER(ALLSELECTED('Table'),[Year_String]=MAX('Table'[Year_String]) to group in measures and use FILTER('Table',[Year_String]=EARLIER('Table'[Year_String]) to group in calcualted columns.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jayasurya_prud , You can have column
max(Table[Year_num]) - [Year_num]
or a meausre
Maxx(allselected(Table),Table[Year_num]) - max(Table[Year_num])
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.