Forum Discussion
Previous rows value based on date (Nested Window Function from Azure DatbricksSQL in Power BI logic)
- 2 years ago
Created a mew measure for the colum and used the Fn like below. Its working,
RunningTotal = CALCULATE (SUM ( [EventsCount] ),ALL ( data_customized ),data_customized[servertime] <= EARLIER (data_customized[servertime]))Thank you.
ssspk
There are many ways to achieve running total. Assuming you aready have a measure called eventCount in your model.
Calculate([EventCount], Filter(Allselected(TableName) , Table[Date_value] <=Max(Table[Date_Value]) ))
for your reference: https://www.sqlbi.com/articles/computing-running-totals-in-dax/
If the post helps please give a thumbs up
If it solves your issue, please accept it as the solution to help the other members find it more quickly.
Tharun
Hi Tharun,
Thank you for reply.But i am getting the below error.
Attached image for your reference.
Thank you.
- tharunkumarRTK2 years agoSuper User
Hi
You are creating a caculated column, I gave an example syntax for measure.
Also, while writing the measure I assumed that you have a measure called EventsCount
if that is not the case then please create the measure first.- ssspk2 years agoHelper III
HI,
Tharun Thank you for your reply and time. I am a new bee to the topic.
yes its a calculated column.
For new colum i have used like below,
= Table.AddColumn(#"Renamed Columns", "RunningTotal", each CALCULATE([EventsCount], Filter(Allselected(data_customized) , Table[servertime] <=Max(Table[servertime]) )))
Atached images for your reference,
Thank you.
- ssspk2 years agoHelper III
Hi Tharun,
I am getting the below error in the Table view itself.Attached screen shorts.
Its says cannot found or may be not used in the expression is thrown.
Thanks in advance.