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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.