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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
SoyeFBI
New Member

DAX for a Fraction that changes with respect to Numerator & Denominator:

I need help in creating a DAX that changes once we have both the numerator and denominator for a Month.

 

Reconciliation Factor April  = Numerator/Denominator;

 

So for May; I want the Reconciliation Fatcor to change once I update Numerator and Denominator as the current Reconciliation Factor.

so this is the DAX i use at the moment:

Latest_RF = CALCULATE('RF Dashboard'[RF_DEF],'Date'[Year]=2023 && 'Date'[Month]="Apr-2023")
 
where,
RF_DEF = IF(ISBLANK(CALCULATE(DIVIDE([TOTAL_A],1000*[TOTAL_B]))),0,CALCULATE(DIVIDE([TOTAL_B],1000*[TOTAL_A])))

 

 

MonthABRF (%)
Jan-20232000015000 75%
Feb-2023300001000033%
Mar-2023250001500060%
Apr-2023150001000067%

 

How can I modify this DAX so at any filter it shows the latest RF? that is if values (A&B) are entered for May-2023, it automatically shows the latest RF.

Latest_RF = CALCULATE('RF Dashboard'[RF_DEF],'Date'[Year]=2023 && 'Date'[Month]="Apr-2023")

3 REPLIES 3
SoyeFBI
New Member

How can I dynamically create the variable for last month that changes with time?

Latest_RF =
var maxmonth= maxx('Table',[Month])
return calculate(max('Table'[RF (%)]),'Table'[Month]=maxmonth)
lbendlin
Super User
Super User

Before you calculate Latest_RF  you add a step to assign a variable to the latest month with data. Then use that variable in your CALCULATE filters.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.