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 Team,
Need your help to crack the formula to find out the amount for each month with the given date range
for eg.:
From Date is 05-11-2021,
To date is 06-01-2022,
Invoice amount is 10800,
Total No.of Days are 63,
Per Day Amount is 171,
There will be 12 Calculated column for each month from April to October the value has to reflect 0
for November month value has to reflect for 26 days * per Day Amount
for December month value has to reflect for 31 days * Per Day Amount
for January month value has to reflect for 6 days * Per Day Amount
Please find the attachment and help me to get formulas, Also the date range includes leap year
FROM Date | To Date | Invoice Amount | CC_Activity_No_of_Days | CC_PerDayInvoiceAmount | CC_April | CC_May | CC_June | CC_July | CC_August | CC_September | CC_October | CC_November | CC_December | CC_January | CC_February | CC_March | Total |
20-Mar-24 | 02-Apr-24 | 3,240.00 | 14 | 231.43 | 462.86 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 2,777.14 | 3,240.00 |
11-Apr-24 | 24-Apr-24 | 8,287.99 | 14 | 592.00 | 8,287.99 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 8,287.99 |
05-Nov-21 | 06-Jan-22 | 10,800.00 | 63 | 171.43 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 4457.14 | 5314.29 | 1028.57 | 0.00 | 0.00 | 10,800.00 |
05-Dec-22 | 01-Mar-23 | 11,500.00 | 87 | 132.18 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 3,568.97 | 4,097.70 | 3,701.15 | 132.18 | 11,500.00 |
15-Nov-23 | 05-Mar-24 | 18,600.00 | 112 | 166.07 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 2,657.14 | 5,148.21 | 5,148.21 | 4,816.07 | 830.36 | 18,600.00 |
Thank you
MSKarthikeyan
Solved! Go to Solution.
Hello @msk_muthu ,
Here is a dax giving same data you want as per sample given. This is dynamic and can run on any data provided.
//Idea was to achieve expected output and hence did not focus on formatting and optimization. I know you will do as needed
// This is not the best code honestly but will work on any data in given format. you can create variables and pass as per your need to simplyfy the query
Did I answer your query ? Please mark this as solution if this helps. Always love your Kudos 🙂
Cheers
Hello @msk_muthu ,
Here is a dax giving same data you want as per sample given. This is dynamic and can run on any data provided.
//Idea was to achieve expected output and hence did not focus on formatting and optimization. I know you will do as needed
// This is not the best code honestly but will work on any data in given format. you can create variables and pass as per your need to simplyfy the query
Did I answer your query ? Please mark this as solution if this helps. Always love your Kudos 🙂
Cheers
Can you provide some more aspect with some dummy data and your exact output and the formula concept.So that we can help you to build the DAX formula.
Regards
sanalytics
If it is your solution then please like and accept it as solution
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
14 | |
11 | |
8 | |
5 |
User | Count |
---|---|
26 | |
21 | |
20 | |
14 | |
10 |