Forum Discussion
NadaBen
9 years agoHelper I
if all
I have a measure : "rupture" which is calculated (substraction) based on two other measures "Stock Week " and stock Week-1. I have good results when i'm in a weekly bucket, but when i'm in total,...
- Anonymous9 years ago
Hi NadaBen,
If you add some specify filter in measure, it will return the wrong result at total row. In my opinion, you can add a condition to filter the total row and add the specify calculation on it.
For example:
Condition Calculate = var currRowLabel=LASTNONBLANK('Table'[Date].[Month],'Table'[Date].[Month]) var currColumnLabel=MAX('Table'[Date].[Year]) return if(COUNTROWS('Table')=COUNTROWS(ALL('Table')), "all",//all if(COUNTROWS('Table')=COUNTROWS(FILTER(ALL('Table'),[Date].[Month]=currRowLabel)), "row",//row if(COUNTROWS('Table')=COUNTROWS(FILTER(ALL('Table'),[Date].[Year]=currColumnLabel)), "column",//column SUM('Table'[Amount]))))Regards,
Xiaoxin Sheng
Anonymous
9 years agoNot applicable
Hi NadaBen,
If you add some specify filter in measure, it will return the wrong result at total row. In my opinion, you can add a condition to filter the total row and add the specify calculation on it.
For example:
Condition Calculate =
var currRowLabel=LASTNONBLANK('Table'[Date].[Month],'Table'[Date].[Month])
var currColumnLabel=MAX('Table'[Date].[Year])
return
if(COUNTROWS('Table')=COUNTROWS(ALL('Table')),
"all",//all
if(COUNTROWS('Table')=COUNTROWS(FILTER(ALL('Table'),[Date].[Month]=currRowLabel)),
"row",//row
if(COUNTROWS('Table')=COUNTROWS(FILTER(ALL('Table'),[Date].[Year]=currColumnLabel)),
"column",//column
SUM('Table'[Amount]))))
Regards,
Xiaoxin Sheng
- NadaBen9 years agoHelper I
Many Thanks