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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
snawalkishore
New Member

Show data in Matrix visual as Actuals for months completed and rest as forecast for future months

Hello Experts,

 

Please find my requirement. 

 

I will receive actual every month (Screenshot1), however I must consider only till last month (i.e Month(now)-1) which should be dynamic. Also I will receive forecast (as in Screenshot2)

 

Requirement is in last screenshot. Till P01 to P04 Actual Data(40) and from P05 to P12 forecast Data(60) 
and finally total of Actual and forecast(100).

 

Actual Data every month will be updatedActual Data every month will be updatedForecast Data every month will be reduced month by month till it reaches P12Forecast Data every month will be reduced month by month till it reaches P12required output in Power BIrequired output in Power BI

 

 

 

 

 

I have wrote DAX Measures, however its not showing correct output.
I'm not sure where is my logic need to be changed, As its calculating both Actual and forecast(102) or calculating only Forecast(60). Its not giving 100

 

 

PowerBI_output2.PNGPowerBI_output1.PNG

 

 

 

 

 

 

URL to download PBIX and xlxs

 

 

Cheers,
Nawal

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @snawalkishore

 

You may add a month number column for actual table as below. Then you may get the value with a measure. Here is the sample file for your reference.

MonthNo = MONTH(DATEVALUE(Actual[MonthName]&"/1"))
Measure =
CALCULATE (
    SUM ( Actual[Hours] ),
    FILTER (
        Actual,
        Actual[MonthNo]
            <= MONTH ( NOW () ) - 1
            && Actual[Type] = "Actual"
            || Actual[Type] = "Forecast"
    )
)

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @snawalkishore

 

You may add a month number column for actual table as below. Then you may get the value with a measure. Here is the sample file for your reference.

MonthNo = MONTH(DATEVALUE(Actual[MonthName]&"/1"))
Measure =
CALCULATE (
    SUM ( Actual[Hours] ),
    FILTER (
        Actual,
        Actual[MonthNo]
            <= MONTH ( NOW () ) - 1
            && Actual[Type] = "Actual"
            || Actual[Type] = "Forecast"
    )
)

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mwegener
Most Valuable Professional
Most Valuable Professional

Hi,

maybe you should extract the numeric month value with Power Query and filter on it.

 

Sample:

 

let
    Source = Excel.Workbook(File.Contents("C:\xxx\Test.xlsx"), null, true),
    Actual_Sheet = Source{[Item="Actual",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Actual_Sheet, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"MonthName", type text}, {"Month", type text}, {"Hours", type number}, {"Type", type text}}),
    #"Inserted Last Characters" = Table.AddColumn(#"Changed Type", "Last Characters", each Text.End([Month], 2), type text),
    #"Changed Type1" = Table.TransformColumnTypes(#"Inserted Last Characters",{{"Last Characters", Int64.Type}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Last Characters", "Month Digit"}}),
    #"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each [Month Digit] < Date.Month(DateTime.LocalNow()) -1)
in
    #"Filtered Rows"

If I answered your question, please mark my post as solution, this will also help others.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors