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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.