Forum Discussion
sayali_deshmukh
6 years agoHelper III
Calculated column for Daily values from Cumulative values
Hi, Need a calculated column for daily values from cumulative values type and category wise. Table is as per below - Type Category Date Cumulative Daily Domestic A 21-04-2020 1 D...
v-yuta-msft
6 years agoCommunity Support
Create two calculate columns using dax as below:
Rank = RANKX(FILTER('Table', 'Table'[Type] = EARLIER('Table'[Type]) && 'Table'[Category] = EARLIER('Table'[Category])), 'Table'[Index], , ASC, Dense)
Column =
VAR Current_Rank = 'Table'[Rank]
VAR Current_CumulativeDaily = 'Table'[CumulativeDaily]
RETURN
IF (
Current_Rank = 1,
Current_CumulativeDaily,
Current_CumulativeDaily
- CALCULATE (
MAX ( 'Table'[CumulativeDaily] ),
FILTER (
'Table',
'Table'[Category] = EARLIER ( 'Table'[Category] )
&& 'Table'[Type] = EARLIER ( 'Table'[Type] )
&& 'Table'[Rank] = Current_Rank - 1
)
)
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.