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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

August Carousel

Fabric Community Update - August 2024

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