The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I've been stuck with this problem for three days already. I've tested multiple date and time intelligence functions to store the output of today's month but all have failed. What I want to happen is that regardless of what the value of the Numerator and Denominator is in the succeeding months, the output to be shown in the succeeding months should be the same as the output given on today's month. For example, since the month today is May 2025, I want the output of Numerator/Denominator in the succeeding months to be the same. Something like the sample shown in the image.
Summary of the premise:
Today is May
For the month of May, and previous, I want Output = Numerator/Denominator.
For any month after May I want Output = 67.16%
General case:
If Date Period is equal to or prior to Current Period, Output = Numerator/Denominator. Else;
If Date Period is after Current Period, Output = Numerator of Current Period/Denominator of Current Date Period
Solved! Go to Solution.
I suggest using the DAX formula below:
FixedOutputMeasure =
VAR CurrentMonth = EOMONTH(TODAY(), 0)
VAR SelectedMonth = MAX('Date'[Date])
VAR ThisMonthNumerator =
CALCULATE(
SUM('Table'[Numerator]),
'Date'[Date] <= CurrentMonth,
EOMONTH('Date'[Date], 0) = CurrentMonth
)
VAR ThisMonthDenominator =
CALCULATE(
SUM('Table'[Denominator]),
'Date'[Date] <= CurrentMonth,
EOMONTH('Date'[Date], 0) = CurrentMonth
)
VAR NormalNumerator = SUM('Table'[Numerator])
VAR NormalDenominator = SUM('Table'[Denominator])
RETURN
IF(
EOMONTH(SelectedMonth, 0) <= CurrentMonth,
DIVIDE(NormalNumerator, NormalDenominator),
DIVIDE(ThisMonthNumerator, ThisMonthDenominator)
)
This formula checks whether the current row’s month is before or equal to May 2025 (or the current month).
If it is → it calculates the usual Numerator / Denominator.
If it’s a future month → it keeps showing the result from May 2025.
Let me know if you'd like to adjust it to work with a slicer instead of TODAY(), or if you're working with measures instead of columns.
If it solves your issue, feel free to mark it as the accepted solution so others can benefit as well. And if you found it helpful, a thumbs-up is always appreciated!
Hi @tricloro9898 ,
I wanted to follow up and see if you’ve had a chance to review the information provided here.
If any of the responses helped solve your issue, please consider marking it "Accept as Solution" and giving it a 'Kudos' to help others easily find it.
Let me know if you have any further questions!
I suggest using the DAX formula below:
FixedOutputMeasure =
VAR CurrentMonth = EOMONTH(TODAY(), 0)
VAR SelectedMonth = MAX('Date'[Date])
VAR ThisMonthNumerator =
CALCULATE(
SUM('Table'[Numerator]),
'Date'[Date] <= CurrentMonth,
EOMONTH('Date'[Date], 0) = CurrentMonth
)
VAR ThisMonthDenominator =
CALCULATE(
SUM('Table'[Denominator]),
'Date'[Date] <= CurrentMonth,
EOMONTH('Date'[Date], 0) = CurrentMonth
)
VAR NormalNumerator = SUM('Table'[Numerator])
VAR NormalDenominator = SUM('Table'[Denominator])
RETURN
IF(
EOMONTH(SelectedMonth, 0) <= CurrentMonth,
DIVIDE(NormalNumerator, NormalDenominator),
DIVIDE(ThisMonthNumerator, ThisMonthDenominator)
)
This formula checks whether the current row’s month is before or equal to May 2025 (or the current month).
If it is → it calculates the usual Numerator / Denominator.
If it’s a future month → it keeps showing the result from May 2025.
Let me know if you'd like to adjust it to work with a slicer instead of TODAY(), or if you're working with measures instead of columns.
If it solves your issue, feel free to mark it as the accepted solution so others can benefit as well. And if you found it helpful, a thumbs-up is always appreciated!
Hi @tricloro9898 ,
I was able to achieve this using the following DAX measure output:
Output % =
VAR CurrentPeriod =
CALCULATETABLE (
TestTable,
MONTH(TestTable[Date]) = MONTH(TODAY()) &&
YEAR(TestTable[Date]) = YEAR(TODAY())
)
VAR CurrentNumerator =
MAXX (CurrentPeriod, TestTable[Numerator])
VAR CurrentDenominator =
MAXX (CurrentPeriod, TestTable[Denominator])
VAR CurrentOutput =
DIVIDE (CurrentNumerator, CurrentDenominator)
RETURN
IF(
MAX(TestTable[Date]) <= EOMONTH(TODAY(), 0),
DIVIDE(MAX(TestTable[Numerator]), MAX(TestTable[Denominator])),
CurrentOutput
)
Here is a screenshot of how my Power BI visual looks with this measure applied to your sample data:
Please let me know if this works on your end!
If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.
Thanks,
Samson
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |