Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
Data---> FILE
I have following querry:
I want to create a measure that can calculate future emission (i.e. Forecast =Y) with 15 Percent of increase. To get the acquired furure results I want to take June total emission from month of August as it considered as to peak emission month. For Septemeber forecast, I would like to multiply with 15% to August Emission value. Smilarly for October forecast, I multiply 15% with Septemeber emission.
I tried with following measure but it is not giving acquired results.
Thankyou in anticipation,
Solved! Go to Solution.
Hi @sam_hoccane
Here is the sample file with the modification https://www.dropbox.com/t/w8M4gpY3GYZeSNKa
Comulative 30% Increase =
SUMX (
VALUES ( data[Year_Month] ),
CALCULATE (
VAR Percentage = 0.3
VAR CurrentDate = MAX ( data[Date] )
VAR CurrentForecast = SELECTEDVALUE ( data[Forecast] )
VAR CurrentEmission = SUM ( data[Emission] )
VAR SummaryTable =
CALCULATETABLE (
SUMMARIZE (
Data,
data[Year_Month],
"@Date", MAX ( data[Date] ),
"@Forcast", SELECTEDVALUE ( data[Forecast] ),
"@Emission", SUM ( data[Emission] )
),
ALLEXCEPT ( data, data[Travel Source], data[Manager] )
)
VAR NTable = FILTER ( SummaryTable, [@Forcast] = "N" )
VAR YTable = FILTER ( SummaryTable, [@Forcast] = "Y" )
VAR Last2NRecords = TOPN ( 2, NTable, [@Date] )
VAR PenultimateNDate = MINX ( Last2NRecords, [@Date] )
VAR PenultimateNEmission= MINX ( FILTER ( Last2NRecords, [@Date] = PenultimateNDate ), [@Emission] )
VAR YTableBefore = FILTER ( YTable, [@Date] < CurrentDate )
VAR Result =
IF (
CurrentForecast = "N",
CurrentEmission,
PenultimateNEmission * POWER ( 1 + Percentage, COUNTROWS ( YTableBefore ) )
)
RETURN
Result
)
)
Hi @sam_hoccane
Here is the sample file with the modification https://www.dropbox.com/t/w8M4gpY3GYZeSNKa
Comulative 30% Increase =
SUMX (
VALUES ( data[Year_Month] ),
CALCULATE (
VAR Percentage = 0.3
VAR CurrentDate = MAX ( data[Date] )
VAR CurrentForecast = SELECTEDVALUE ( data[Forecast] )
VAR CurrentEmission = SUM ( data[Emission] )
VAR SummaryTable =
CALCULATETABLE (
SUMMARIZE (
Data,
data[Year_Month],
"@Date", MAX ( data[Date] ),
"@Forcast", SELECTEDVALUE ( data[Forecast] ),
"@Emission", SUM ( data[Emission] )
),
ALLEXCEPT ( data, data[Travel Source], data[Manager] )
)
VAR NTable = FILTER ( SummaryTable, [@Forcast] = "N" )
VAR YTable = FILTER ( SummaryTable, [@Forcast] = "Y" )
VAR Last2NRecords = TOPN ( 2, NTable, [@Date] )
VAR PenultimateNDate = MINX ( Last2NRecords, [@Date] )
VAR PenultimateNEmission= MINX ( FILTER ( Last2NRecords, [@Date] = PenultimateNDate ), [@Emission] )
VAR YTableBefore = FILTER ( YTable, [@Date] < CurrentDate )
VAR Result =
IF (
CurrentForecast = "N",
CurrentEmission,
PenultimateNEmission * POWER ( 1 + Percentage, COUNTROWS ( YTableBefore ) )
)
RETURN
Result
)
)
Hi @sam_hoccane
please try
Comulative 30% Increase =
SUMX (
VALUES ( data[Year_Month] ),
CALCULATE (
VAR Percentage = 0.3
VAR CurrentDate =
MAX ( data[Date] )
VAR CurrentForecast =
SELECTEDVALUE ( data[Forecast] )
VAR CurrentEmission =
SUM ( data[Emission] )
VAR SummaryTable =
CALCULATETABLE (
SUMMARIZE (
Data,
data[Year_Month],
"@Date", MAX ( data[Date] ),
"@Forcast", SELECTEDVALUE ( data[Forecast] ),
"@Emission", SUM ( data[Emission] )
),
ALLSELECTED ( data )
)
VAR NTable =
FILTER ( SummaryTable, [@Forcast] = "N" )
VAR YTable =
FILTER ( SummaryTable, [@Forcast] = "Y" )
VAR Last2NRecords =
TOPN ( 2, NTable, [@Date] )
VAR PenultimateNDate =
MINX ( Last2NRecords, [@Date] )
VAR PenultimateNEmission =
MINX ( FILTER ( Last2NRecords, [@Date] = PenultimateNDate ), [@Emission] )
VAR YTableBefore =
FILTER ( YTable, [@Date] < CurrentDate )
VAR Result =
IF (
CurrentForecast = "N",
CurrentEmission,
PenultimateNEmission
* POWER ( 1 + Percentage, COUNTROWS ( YTableBefore ) )
)
RETURN
Result
)
)
Hi @sam_hoccane
well, it wasn't easy. Please refer to the sample file wit the solution https://www.dropbox.com/t/cEbymwCwrT06CJz6
Comulative 30% Increase =
SUMX (
VALUES ( data[Year_Month] ),
CALCULATE (
VAR Percentage = 0.3
VAR CurrentDate = MAX ( data[Date] )
VAR CurrentForecast = SELECTEDVALUE ( data[Forecast] )
VAR CurrentEmission = SUM ( data[Emission] )
VAR SummaryTable =
CALCULATETABLE (
SUMMARIZE (
Data,
data[Year_Month],
"@Date", MAX ( data[Date] ),
"@Forcast", SELECTEDVALUE ( data[Forecast] ),
"@Emission", SUM ( data[Emission] )
),
ALL ( data )
)
VAR NTable = FILTER ( SummaryTable, [@Forcast] = "N" )
VAR YTable = FILTER ( SummaryTable, [@Forcast] = "Y" )
VAR Last2NRecords = TOPN ( 2, NTable, [@Date] )
VAR PenultimateNDate = MINX ( Last2NRecords, [@Date] )
VAR PenultimateNEmission= MINX ( FILTER ( Last2NRecords, [@Date] = PenultimateNDate ), [@Emission] )
VAR YTableBefore = FILTER ( YTable, [@Date] < CurrentDate )
VAR Result =
IF (
CurrentForecast = "N",
CurrentEmission,
PenultimateNEmission * POWER ( 1 + Percentage, COUNTROWS ( YTableBefore ) )
)
RETURN
Result
)
)
@tamerj1 : Thankyou so much for helping me in this...
Last question if use slicer of Manager and Travel Source on measure, it is not giving desired results. how can I manuplate the above masure to satisfy this condition.
Many Thanks,
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |