March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi, I'm new in Power Bi and I have one problem. I have the following dataset:
I would like to plot a drawdown for each Id_Fund over time. I want this graph to vary as i change the period and the Id_Fund.
For example, in following graph done in python, i have the drawdown graph, but static. I would like this graph changes with date slicer.
My logic for solving this problem is as follow: I have to create a rolling max, that is, for each day I calculate the max value since my initial date (initial date in date slicer). From that, I divide the current value by the max value.
I build this logic in python, but I cant do it in power bi and create a dynamic graph. Below is the code in python.
# Data: create a column for each Id_fund (In power bi, I think this is not necessary)
cota = NAV_SHARE.pivot(index="Dt_FundNavDate",columns="Id_Fund",values="Vlr_FundNavValue")
cota.reset_index("Dt_FundNavDate",inplace=True)
cota["Dt_FundNavDate"] = pd.to_datetime(retorno["Dt_FundNavDate"],format="%Y-%m-%d")
# Rolling max and calculate de drawdown
RollMax = retorno.cota(1000,min_periods=1).max() # The number 1000 is arbitrary.
dailydd = cota/RollMax -1
Thanks,
Jadson
Hi,
Could you sow the expected result in a Table format.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
91 | |
74 | |
58 | |
53 |
User | Count |
---|---|
196 | |
116 | |
107 | |
67 | |
64 |