The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi all, I have an R loop that I'm running at Power Query level in Power BI. I'd like to be able to move this into DAX so I can use a parameter in my report, that the report user can add in themselves.
This is the R script:
tot <- dataset$Total
m_start <- dataset$Date
m_days <- dataset$DaysinMonth
s_lb <- dataset$Oustanding #Fixed value I want to use as a parameter instead
s_lb <- s_lb[1]
i <- 1
v1 <- c()
v2 <- c()
while (i<=length(dataset$Total)){
int <- ((s_lb*0.12)/365)*m_days[i]
s_lb <- s_lb - tot[i] + int
v1 <- c(v1,s_lb)
v2 <- c(v2,int)
i <- i + 1
}
output <- data.frame(m_start,tot,v2,v1)
This produces two new columns using v1 and v2. Currently I have added the parameter as a column with the same value for each row. Ideally this would just be the parameter value the report user can input.
Any input on this would be great, I'm not entirely sure it is possible, but loops in DAX I find extremely difficult to get my head around.
Hi @che1569250
Sorry I'm not quite understand the calculation logic, could you plz consider providing your dummy pbix that would be helpful for us to investigate it further.
You can upload it to the onedrive for business and share the link here. please don't forget to disclose the expected results and remove the confidential info.
Hi, this is a link to a Power BI file with a table of how the data starts and another table with how I want the data to look at the end. I need this to be done via DAX as I want to be able to enter "outstanding balance" as a parameter so it can change and update.
Also, this a link to a file to show how I can do it in Excel.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
98 | |
92 | |
90 | |
72 | |
69 |
User | Count |
---|---|
231 | |
127 | |
117 | |
82 | |
82 |