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
antalford88
Regular Visitor

MAXIFS for Dax - Forecast increase

I'm trying to apply the same logic used in an excel doc within Power BI with little luck.

 

I have a set of forecasts listed out at forecast_name level. Each forecast is attributed to a date. I then have another document (parameter sheet) in which a user can amend certain elements which in turn either increase of decrease the existing forecast. 

 

The excel file contains a MAXIFS calculation per below:

 

=MAXIFS('CTR change sheet'!N:N,'CTR change sheet'!B:B,[@[forecast_name_high_level]],'CTR change sheet'!H:H,"<="&[@date])

 

Essentially this will increase or decrease the forecast_name level from the date listed on the parameter sheet, onwards.

 

My Power BI format include the existing list of forecasts by date and forecast_name. I've also uploaded the parameter sheet. I've creaed a calculated measure that will amend the forecast but as it stands it will inflate or deflate every date attributed to the forecast_name as opposed to the specific date + future dates.

 

Fcst Change = [Fcst] * (1 + [Expected Change in Fcst])
 
Both forecast sheet and parameter sheet are modelled to date dimensions and name dimension. 
 
Is there a way to wrap by [Fcst] * (1 + [Expected Change in Fcst]) in some logic that points to the date in the parameter sheet and MAXIFS that to the forecastsheet?

 

 

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@antalford88 ,

 

Not very clear about excel formula. You may create a measure using dax like pattern below:

Result =
VAR _date =
    SELECTEDVALUE ( 'CTR change sheet'[forecast_name_high_level] )
RETURN
    CALCULATE (
        MAX ( 'CTR change sheet'[forecast_name_high_level] ),
        FILTER (
            'CTR change sheet',
            'CTR change sheet'[forecast_name_high_level] <= _date
        )
    )

You can also refer to the similar threads which may help you below:

https://community.powerbi.com/t5/Desktop/Dax-for-maxif/td-p/354825

https://community.powerbi.com/t5/Desktop/Translation-of-MAXIFS-excel-formula-into-DAX/td-p/75284

https://community.powerbi.com/t5/Desktop/DAX-Calculation-MAX-if-for-multiple-criteiria-Most-recent-d...

 

Community Support Team _ Jimmy Tao

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

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@antalford88 ,

 

Not very clear about excel formula. You may create a measure using dax like pattern below:

Result =
VAR _date =
    SELECTEDVALUE ( 'CTR change sheet'[forecast_name_high_level] )
RETURN
    CALCULATE (
        MAX ( 'CTR change sheet'[forecast_name_high_level] ),
        FILTER (
            'CTR change sheet',
            'CTR change sheet'[forecast_name_high_level] <= _date
        )
    )

You can also refer to the similar threads which may help you below:

https://community.powerbi.com/t5/Desktop/Dax-for-maxif/td-p/354825

https://community.powerbi.com/t5/Desktop/Translation-of-MAXIFS-excel-formula-into-DAX/td-p/75284

https://community.powerbi.com/t5/Desktop/DAX-Calculation-MAX-if-for-multiple-criteiria-Most-recent-d...

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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.