Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I'm having trouble with my DAX. I'm trying to calculate a Run Rate based on which fiscal day in the month or day in the quarter it is. Everything looks correct except that the Q1 run rate is dividing based on the Selected Day in the Year-Mo for the last month in that quarter. Here's my table:
There are 3 conditions to determine the run rate:
Everything in the Total Booking RR column is correct except the 2025-Q1 value. That is dividing 9,311 by 25, not 61. The run rate for Q1 should be 152.64
Can someone assist me with trying to figure out how to switch the divisor values based on if it's showing Year-Qtr or Year-Mo?
Here are my DAX measures:
Selected Day in Year-Mo = lookupvalue(Dates[CADIM],Dates[PADDATE], [Max Date])
Day in Quarter Yesterday = lookupvalue(Dates[CADIQ],Dates[PADDATE], Today()-1 )
(PADDATE = date)
My DATE table has column which store the day in the month (CADIM) and the day in the quarter (CADIQ).
Any assistance would be great appreciated.
Solved! Go to Solution.
Hi @Roseventura,
We are grateful for your participation in the Microsoft Fabric Community forum.
As per my understanding of your question, please try the DAX measure below — it may help you:
Total Booking RR =
VAR MaxDate = MAX(Dates[PADDATE])
VAR SelectDIYrMo = LOOKUPVALUE(Dates[CADIM], Dates[PADDATE], MaxDate)
VAR SelectDIYrQtr = LOOKUPVALUE(Dates[CADIQ], Dates[PADDATE], MaxDate)
VAR DIQYesterday = LOOKUPVALUE(Dates[CADIQ], Dates[PADDATE], TODAY() - 1)
VAR TodaysYQ = LOOKUPVALUE(Dates[YEAR-QTR], Dates[PADDATE], TODAY())
VAR CurrentYQ = SELECTEDVALUE(Dates[YEAR-QTR])
VAR CurrentYM = SELECTEDVALUE(Dates[YEAR-MO])
VAR IsQuarterRow = ISBLANK(CurrentYM)
VAR FindYrQtr =
IF(
CurrentYQ = TodaysYQ,
DIQYesterday,
IF(IsQuarterRow, SelectDIYrQtr, SelectDIYrMo)
)
VAR Calc = DIVIDE([Total Booking $], FindYrQtr, 0)
RETURN
Calc
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi @Roseventura,
We are grateful for your participation in the Microsoft Fabric Community forum.
As per my understanding of your question, please try the DAX measure below — it may help you:
Total Booking RR =
VAR MaxDate = MAX(Dates[PADDATE])
VAR SelectDIYrMo = LOOKUPVALUE(Dates[CADIM], Dates[PADDATE], MaxDate)
VAR SelectDIYrQtr = LOOKUPVALUE(Dates[CADIQ], Dates[PADDATE], MaxDate)
VAR DIQYesterday = LOOKUPVALUE(Dates[CADIQ], Dates[PADDATE], TODAY() - 1)
VAR TodaysYQ = LOOKUPVALUE(Dates[YEAR-QTR], Dates[PADDATE], TODAY())
VAR CurrentYQ = SELECTEDVALUE(Dates[YEAR-QTR])
VAR CurrentYM = SELECTEDVALUE(Dates[YEAR-MO])
VAR IsQuarterRow = ISBLANK(CurrentYM)
VAR FindYrQtr =
IF(
CurrentYQ = TodaysYQ,
DIQYesterday,
IF(IsQuarterRow, SelectDIYrQtr, SelectDIYrMo)
)
VAR Calc = DIVIDE([Total Booking $], FindYrQtr, 0)
RETURN
Calc
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Thank you! That tweak is what did it! Thank you so much for the quick answer!
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
75 | |
68 | |
41 | |
35 |
User | Count |
---|---|
102 | |
56 | |
52 | |
46 | |
40 |