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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

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
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.