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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

help with measures and date intervals

Hello,

 

I'm currently working with invoice data for the company that i work for.  One of the visuals that i need to create is a table containing the counts of unposted invoices over specific date intervals such as 0-20 days, 21-30 days etc as well as the total value of these invoices.

 

The aim is the table below.

 

Salty134_0-1624530968582.png

 

Currently i'm using very inflexible formulas to work these out as measures

E.G this is what i'm using to calculate the count of unposted date for the 0-20 day interval.

0 to 20 Days = CALCULATE([Count of unposted flag], FILTER('P2P vwPurchaseInvoice', DATEDIFF([InvoiceDate], [PeriodDateSelected], DAY) >= 0 && DATEDIFF([InvoiceDate], [PeriodDateSelected], DAY) <= 20))
 
[PeriodDateSelected] is a measure that grabs the value of the PeriodEndDate slicer. The idea being that the values in the table should update based on the value selected in the slicer.
 
What i would like is to have the total amount of unposted values and then drop the date intervals onto the canvas to split the numbers into their relevant time interval 'bins'. And then the same for the value of these invoices.
 
Currently because of the rigid formulas used in my measures i cannot combine the value table with the count table.
 
Please could anyone help?
 
N.b i would include what the visual currently looks like but i cannot publish company data.
 
 
 
1 REPLY 1
amitchandak
Super User
Super User

@Anonymous ,

You need a measure

DATEDIFF(min([InvoiceDate]), [PeriodDateSelected], DAY)

 

now this measure need work at the invoice or invoice line level

 

example

averagex(Values(Invoice[Invoice]), DATEDIFF(min([InvoiceDate]), [PeriodDateSelected], DAY) )

 

you need to bucket this. you need an independent table and you have to group it back at invoice or line-level again in new measures 

 

refer by video on the same

Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors