Forum Discussion
zawlh
Helper I
6 years agoCalculate % change from previous column
Hello everyone, I am new to Power BI. We used Postgres data from our chatbot system. So this is our chatbot result. I would like to calculate % change with line value showing how many % of user...
zawlh
Helper I
6 years agoaz38 the number is the distinctcount of messengerID. I want percent difference from previous column(column from chart). (For eg. 38% drop from day01-begin to day01-end (assuming day01-begin is 100%). Could you solve it ?
az38
Community Champion
6 years agoits still not almost clear but try to create a measure like
Measure =
var _prevDayNumberStart = CALCULATE(MAX('Table'[Day Number]), FILTER(ALL('Table'), 'Table'[timestamp] < SELECTEDVALUE('Table'[timestamp]) && CONTAINSSTRING('Table'[Day Number],"begin"))
var _prevDayTimestamp = CALCULATE(MAX('Table'[timestamp]), 'Table'[Day Number]=_prevDayNumberStart)
RETURN
DIVIDE( CALCULATE(DISTINCTCOUNT('Table'[messenger_id]), FILTER(ALL('Table'), 'Table'[timestamp] < SELECTEDVALUE('Table'[timestamp])), CALCULATE(DISTINCTCOUNT('Table'[messenger_id]), FILTER(ALL('Table'), 'Table'[timestamp] < _prevDayTimestamp) )not sure, it will work, need to check
do not hesitate to give a kudo to useful posts and mark solutions as solution