Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
avalerion
Frequent Visitor

Excel formula - is this feasible in Power BI?

I have a very critical formula to evaluate by row, how much of an amount falls between one or more dates. The detailed question is here: http://superuser.com/questions/723200/excel-dates-how-much-of-a-period-falls-in-a-financial-year

 

But the formula is this:

=MAX(0,MIN(ENDDATE,ENDOFMONTH)-MAX(STARTDATE,BEGINOFMONTH))

 

So where an example month is 3/1/2015-3/31/2015, an invoice would show 2/15/2015-3/5/2015 and return 5 days for the March period.

 

Is this possible to create by adding custom columns for each period, and what would it look like in Dax?

 

 

3 REPLIES 3
kcantor
Community Champion
Community Champion

There is a forum over at powerpivotpro.com that you could ask this question in. I am beyond positive that you would have an answer quickly from them. Not saying anything negative about this forum at all. I love it here. But there are some DAX gurus on that forum who can create the most amazing measures.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Without an understanding of what your data looks like it's nearly impossible to suggest solutions. Sample data (doesn't have to be real, just mock up something with the same structure) would be incredibly helpful in helping you. And please don't just screenshot an Excel sheet. No one wants to enter all of your data by hand. Share a workbook on OneDrive or similar.

GilesWalker
Skilled Sharer
Skilled Sharer

If you have a table which contains all days of the year then in theory you could use the COUNTA function to count the number of days for March. Without seeing the data it is tricky, however if you had a table with the months, e.g Jan, Feb, Mar etc. then you could insert the invoice number and then the measure:

 

Days in remaining in invoice = counta(Date[Date Key]) I beleive this would show you the days in month remaining. However like I said without the data I am not too sure.

 

Someone may have a much better example.

 

Giles

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.