Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
I have a 'Total Target' value and I want to achieve this 'Target Kg' column which is nothing but Total Target on the daily basis
So here is the logic how we getting target based on each date:
var A = Calculate(Count([calendar days]), Filter([Holiday]= "No"))
var B= Total Target/ A
if([Holiday]= "No") then Return B + (B of previous day)
else Return B of previous day
Can I get the code or suggestions for this kind of looping logic
Hi @Anonymous
How does your source data look like? Is it one table or multiple? Do you have a date table? Relationships? What are the names of Tables/Columns involved? Is the total target a total sum of a column or a given fixed value or a parameter?
yes I have multiple tables (calendar, target) and Total Target is a sum of coumn. It's just I want this Total Target to be segregated on the day basis with the above logic I gave.
But I don't know how can I apply this looping condition with DAX. I just need a pseudo code for this logic.
@Anonymous
Please present sample data of both tables along with the expected result.
Can you tell me the logic how can I return a cumulative sum like 'var x' + 'var x' of previous date in dax calculated column?
@Anonymous ,Based on what I got
Join this with a date table having all the dates,
Then you can have data for all dates like
calculate(lastnonblankvalues(Table[Date], Sum(Table[Target Qty])), filter(all('Date'), Date[Date] <= max(Date[Date]) ) )