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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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