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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
miii
Frequent Visitor

Actuals and Forecast in a Matrix

Hi -

 

Trying to come up with a measure syntax to display Actuals and Forecast number in a matrix. Please assist with the correct DAX measure syntax. Currently, it's showing "$0" amounts for future months.

 

2019-02-19_16-42-51.png

 

I'm using this:

 

Actuals Forecast:=

if(
	VALUES('Calendar'[Month]) <= Month(Today()),
	[Labor Actuals],
	[Actuals/Forecast]

)

 

1 ACCEPTED SOLUTION

Hi @miii ,

 

You need to redo your measure to something like this:

 

 

Actuals Forecast :=
IF (
    HASONEVALUE ( 'Calendar'[Month] );
    IF ( [Group Actuals Non-Blank] = 0; [Indirect Forecast]; [Indirect Actual] );
    SUMX (
        Calendar;
        IF ( [Group Actuals Non-Blank] = 0; [Indirect Forecast]; [Indirect Actual] )
    )
)

Should work.

 

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

12 REPLIES 12
akramayman
Frequent Visitor

I have almost the same problem but i cant solve it any help 


this is my data model where the base has the Unique value ID from the 3 data table 

akramayman_0-1683186044500.png

 my problem I create a matix visual that has value for first 3 month I need to calculate the forcasting for other month where the forcasting calculation = SUM(previous months) / Count(previous months).

akramayman_1-1683186211991.png

 

any help and thank you 

Hi @akramayman ,

 

Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



check inbox

Joorge_C
Resolver II
Resolver II

Hello, I would suggest creating a Calculated column in the Query with the similar If Condiiton, so you can have a defined column for each, then you can eaither pivot them to see them as attribute or add the columns themselves.

miii
Frequent Visitor

I used the following and it's displaying the monthly forecast now but missing the total amount in the grid. It only returns January number in the total.

 

Actuals Forecast:=

If ([Group Actuals Non-Blank] = 0,
[Indirect Forecast],[Indirect Actual]
)

2019-02-21_10-42-59.png

Hi @miii ,

 

You need to redo your measure to something like this:

 

 

Actuals Forecast :=
IF (
    HASONEVALUE ( 'Calendar'[Month] );
    IF ( [Group Actuals Non-Blank] = 0; [Indirect Forecast]; [Indirect Actual] );
    SUMX (
        Calendar;
        IF ( [Group Actuals Non-Blank] = 0; [Indirect Forecast]; [Indirect Actual] )
    )
)

Should work.

 

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix 
I have the same problem and i would to ask what is the 

[Group Actuals Non-Blank]

also me forcasting calculate it should be the (sum of previous months / count of previous months)

miii
Frequent Visitor

Thank you so much MFelix !!! That worked. I'm new to DAX and PowerBI and finding this community incredibly helpful. Thanks all

MFelix
Super User
Super User

Hi @miii ,

 

Without further details is difficult to give you a correct answer, butare tha Actuals and Actuals/forecast on different tables?

 

Do those tables have a relationship with the Calendar Table?

 

Can you share a sample of the data?

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



miii
Frequent Visitor

Hi MFelix,

 

Yes - 

 

Table1: Forecast Table

Date -> joins to calendar table on date

Division -> joins to a division bridge table

Indirect Labor Forecast -> Measure of forecast by Month

 

 

Table 2: Actuals

Date -> joins to calendar table on date

Division -> joins to a division bridge table

Indirect Labor Actuals -> Measure of actuals by Month

 

And here is a sample:

2019-02-19_16-42-52.png

Hi @miii ,

 

You need to change your measure to:

 

Actuals Forecast =
IF (
    SELECTEDVALUE ( 'Calendar'[Month] ) <= MONTH ( TODAY () ),
[Labor Actuals],
	[Actuals/Forecast]
)

 

 

should work fine

 

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



miii
Frequent Visitor

Unfortunately, "SELECTEDVALUE' syntax is not available in PowerBI version we are using. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.