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
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 )
    )

 

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
Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 123 members 1,874 guests