Aging Buckets measure

Hello -
Im creating a simple measure to creat Aging Buckets and it seems like it doesn’t recognized my “Age in Dates”.
Bucket =
SWITCH(TRUE(),
'PVT AR,'PVT AR[Due Date-Copy] <= 1, “1. 0-30”,
‘PVT AR’[Due Date-Copy] > 1 && ‘PVT AR’[Due Date-Copy] <= 2, “2. 31-60”,
‘PVT AR’[Due Date-Copy] > 2 && ‘PVT AR’[Due Date-Copy] <= 3, “3. 61-90”,
“8. 365+”),
Please help , I checked it with GPT chart and it doesn’t see errors either.
Oracle AR Aging-DC_For Natasha.pbix (10.4 MB)

Thank you very much!
Natasha

@npower,

I see a few reasons why your measure isn’t working.

First, I opened your pbix file, but i didnt see your bucket measure nor did i find the Due Date-Copy column in your PVT AR table. Because of that, I’m not sure how 'PVT AR,'PVT AR[Due Date-Copy] is calculated. If calculated as it seems, i.e., a “copy” of 'PVT AR,'PVT AR[Due Date], your measure won’t find any rows that match because 'PVT AR,'PVT AR[Due Date] is a date in your model but you’re testing against a column seemingly of integers.

Aside from that there are some problems with your syntax:

  1. The table name ‘PVT AR’ should be used in conjunction with the columns being referenced, not after TRUE(). it looks like you’ve mirrored the syntax of an iterator function or a filter function in DAX, where the first argument is often a table or a table expression. The SWITCH function does not start with a table or table expression. Instead, it starts with an expression to evaluate (like TRUE() for a series of boolean conditions) followed by pairs of condition/value arguments.
  2. Make sure the logic for your age buckets fits your requirements. The buckets currently cover ranges of “0-30”, “31-60”, “61-90”, and “365+”. what about 91 through 365?
  3. The default value is “8. 365+”. This means any 'PVT AR,'PVT AR[Due Date-Copy] value that isnt less than or equal to 1, greater than one but less than or equal to 2, or greater than 2 and less than or equal to 3 will be classified as “8. 365+”. is that what you want?