Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi Guys
I have been asked to calculate losses before and after date column. Starting the calculation from Financial year start which is 01.09.2023 until the date column and then seperate measure for calculations from date column until present.
I tried following measure but not giving me correct date
Shops | Dates | Total Loss YTD | |
a | 01.08.2024 | 50000 | |
b | 15.08.2024 | 45000 | |
c | 02.09.2024 | 32000 |
Thank You
Hi @Preetsingh86 ,
Can you provide some sample data? We can better understand the problem and help you.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Rupak thank you for replying, but I am afraid this didn't work
hi @Preetsingh86
You may try this
loss Before=
Var min_date = calculate(min(table,date),all(table))
Var to_date = max(table,date)
return
calculate(sum(table,loss),all(table),table,date>=min_date&&table,date<=to_date)
Same way you can make the after loss as well.
If this doesnot work, please share sample data.
User | Count |
---|---|
21 | |
14 | |
11 | |
7 | |
5 |
User | Count |
---|---|
23 | |
23 | |
20 | |
15 | |
10 |