cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GiuseppeTE Frequent Visitor
Frequent Visitor

dax formula to complete table with lastnoblank value

Hello,

 

this is my first time in the comunity and I am a new user of power bi.

The issue I would like to solve is the follow:

I have to table like below:

table join.JPG

 

where the table 1 have a calculated column with the following formula: 

Output calculated = SUMX(
                                   RELATEDTABLE(Tabella2);
                                                 Tabella2[outputactual]
                                 )

 

table 1.JPG

 

now the issue is:

how I can fill the rest of blank value in the column calculated  with the last one value (15) ? 

 

below the related table2:

table2.JPG

 

thanks in advance for every one would like help me.

Giuseppe

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
GiuseppeTE Frequent Visitor
Frequent Visitor

Re: dax formula to complete table with lastnoblank value

Hello Muhammad,

 

your formula work perfectly.

thanks a lot

Giuseppe

3 REPLIES 3
Super User
Super User

Re: dax formula to complete table with lastnoblank value

@GiuseppeTE 

 

Try this column

 

=
VAR lastavailabledata =
    CALCULATE (
        MAX ( Tabella2[dataworked] ),
        FILTER ( ALL ( Tabella2 ), Tabella2[dataworked] <= Tabella1[data] )
    )
RETURN
    CALCULATE (
        SUM ( Tabella2[outputactual] ),
        FILTER ( ALL ( Tabella2 ), Tabella2[dataworked] = lastavailabledata )
    )

 

Highlighted
GiuseppeTE Frequent Visitor
Frequent Visitor

Re: dax formula to complete table with lastnoblank value

Hello Muhammad,

 

your formula work perfectly.

thanks a lot

Giuseppe

Super User
Super User

Re: dax formula to complete table with lastnoblank value

HI @GiuseppeTE 

 

Thanks for the feedback

 

Please mark the correct answer as solution. I see that you marked your own reply as ANSWER.

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 47 members 1,209 guests
Please welcome our newest community members: