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
yolandacb
Frequent Visitor

Divide row by row based on criteria (Shoe measure on row)

Hello,

 

This dax calculates an average based on future months. 

However, the amount only shows as a total, but I need it to show in the months that are considered future months.

Can you help?

 

 

RF 2 =
VAR MaxDate = MAX(Opex[Month_End_Date])
VAR CurDate = LASTNONBLANK(Opex[Month_End_Date],Opex[Actual1])
VAR LatPeriodwActuals
= CALCULATE(  LASTNONBLANK(Opex[Month_End_Date],Opex[Actual1]), REMOVEFILTERS())
VAR RemainingForecast =


   DIVIDE(
     
       
       ([Forecast1] - [Actual1])
    ,
    ( DATEDIFF(
        CurDate,
        MaxDate,
       
        MONTH)),0)


RETURN
2 REPLIES 2
yolandacb
Frequent Visitor

Hi,

 

I would expect that when Actual1 is nil,

the amount will be displaid on each row in the corresponding row in column RF2.

 

This shows at the moment, and I expect that the circled field would have the amount required.

This should repeat if there's another blank in column Actual1.

The same amount should repeat. The aount shows in the sum at the moment.

 

It's calculting the overall difference between Forecast1 and Actual1 and dividing it by the amount of months to go:

 

yolandacb_0-1679654343489.png

 

Data Set

 

Sample YTG - Power BI

Mahesh0016
Super User
Super User

@yolandacb can you share excepted output and sample data set.

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.

Top Solution Authors