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
armandvdm
Frequent Visitor

Use Debtors Age Bracket as Measure for Axis - Debtors Age analysis

I really need some clever inspiration.

I create a debtors age analysis dynamically for the selected month-end date.

Capture.PNG

The two important date measures are 1) Age in days and age bracket which uses age in days.

Age in days

Age =
var selecteddate =
CALCULATE ( MAX( MonthEndDates[myDate] ), ALLSELECTED ( MonthEndDates ) )
var myage =
DATEDIFF(max(Episode[DischargeDate]),selecteddate,DAY)
return IF(myage <0, -1,MYAGE)
 
and Age bracket
AgeBracket = if([Age] <0, "Current",
if([Age] <= 30, "Current",
IF([Age] <= 60, "30",
IF([Age]<=90 , "60",
IF([Age] <= 120, "90",
"120+"
)))))
 
I want to use Age Bracket as Axis for Graph. As it is a measure I cannot use it.
 
I thought about the workaround using a calculated table and convert the AGE and AgeBracket measures to calculated columns, but as the selection date is dynamic, I cannot access the SELECTEDVALUE or ALLSELECTED slicer value in a column to calculate the date difference between the selected date and discharge date.

 

Hope I explain it correctly. 

 

Regards

 

Armand

2 REPLIES 2
kcantor
Community Champion
Community Champion

@armandvdm 

Have you tried Binning the ages?

https://docs.microsoft.com/en-us/power-bi/desktop-grouping-and-binning





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

Proud to be a Super User!




Thanks, it appears as if PowerBI does not allow binning on a measure column.

 

Regards

 

Armand

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.