Forum Discussion
Atiroocky
3 years agoFrequent Visitor
Column in datatable with dynamic function paramater
Hello, I managed to calculate a cumulative rolling day in a column of my table. I use the function "DATESINPERIOD" I would like to replace the "static" number parameter by a dynamic paramete...
- 3 years ago
Hi Atiroocky
Calculated columns cannot be dynamic as they do not interact with the fiter conext of the report. This has to be a measureCount = CALCULATE ( SUM ( 'Table_DHU'[CityLocation] ), ALL ( 'Table_DHU' ), DATESINPERIOD ( 'Table_DHU'[Date], MAX ( 'Table_DHU'[Date] ), - [Parameter], DAY ) )
tamerj1
3 years agoCommunity Champion
Hi Atiroocky
Calculated columns cannot be dynamic as they do not interact with the fiter conext of the report. This has to be a measure
Count =
CALCULATE (
SUM ( 'Table_DHU'[CityLocation] ),
ALL ( 'Table_DHU' ),
DATESINPERIOD (
'Table_DHU'[Date],
MAX ( 'Table_DHU'[Date] ),
- [Parameter],
DAY
)
)Atiroocky
3 years agoFrequent Visitor
Thanks, that works perfectly !
As a "beginner" I’m not very comfortable playing with "Measures". A bit earlier before posting in this forum, I tried to put the column code in a measure, but I used Table_DHU[Date] as start date instead of "MAX(Table_DHU[Date])". I was returning me an error.
For me "MAX" was the last entry of all table data. But I was thinking as "table" data and no "measure" data. It is still a bit confused in my mind but time will help.
Thanks again !