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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Seek help in convert YTD to LYTD

Hi All

 

I have below expression from Mr Ash :-

 

YTD Total = if(ISBLANK([Total]),BLANK(),if(MIN('Date'[Date])>today(),BLANK(),CALCULATE([Total],DATESYTD('Date'[Date],"31/12"),ALL('Table'[GL CODE]))))
 
Can some one help me convert above the LYTD.
 
Paul
1 ACCEPTED SOLUTION

@Anonymous , 

 

That is working fine, I did check on that. Refre the below screenshot. LYTD is 10. Refre second for the value in table for 2019 as well. 

Both the values are same and attaching file for you reference. 

https://www.dropbox.com/s/qqembxhjv7d8aos/HOW%20TO%20COMPUTE%20REVENUE%20YTD%20V0006.pbix?dl=0

 

manikumar34_0-1603268694898.png

manikumar34_1-1603268750783.png

 

Regards, 

Manikumar

 





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

8 REPLIES 8
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can use something like:

 

YTD Total =
IF (
    ISBLANK ( [Total] ),
    BLANK (),
    IF (
        MIN ( 'Date'[Date] ) > TODAY (),
        BLANK (),
        CALCULATE (
            [Total],
            DATEADD ( DATESYTD ( 'Date'[Date], "31/12" ), -1, YEAR ),
            ALL ( 'Table'[GL CODE] )
        )
    )
)

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

Anonymous
Not applicable

Hi @Anonymous ,

 

You don't have Total column or Total measure in your data model. Use the formula I suggested above.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

Anonymous
Not applicable

Hi Sir

Very sorry that i am still lost. If i use the expression again , it will be still error.

Paul

@Anonymous , 

 

That is working fine, I did check on that. Refre the below screenshot. LYTD is 10. Refre second for the value in table for 2019 as well. 

Both the values are same and attaching file for you reference. 

https://www.dropbox.com/s/qqembxhjv7d8aos/HOW%20TO%20COMPUTE%20REVENUE%20YTD%20V0006.pbix?dl=0

 

manikumar34_0-1603268694898.png

manikumar34_1-1603268750783.png

 

Regards, 

Manikumar

 





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Anonymous
Not applicable

Hi Mani

Thank you very much , now the value appear . I need to further check on it later.

Paul

Anonymous
Not applicable

Hi Ded

Thank you for your sharing , i get error below :-

 

My PBIX file :-

https://www.dropbox.com/s/q93wobh5avy7n9b/HOW%20TO%20COMPUTE%20REVENUE%20YTD%20V0005.pbix?dl=0

 

Paulyeo11_0-1603187439735.png

 

Hi @Anonymous ,

 

Would you please use the following one:

YTD Total = 
IF (
    ISBLANK (SUM('Table'[AMOUNT]) ),
    BLANK (),
    IF (
        MIN ( 'Date'[Date] ) > TODAY (),
        BLANK (),
        CALCULATE (
           SUM('Table'[AMOUNT]),
            DATEADD ( DATESYTD ( 'Date'[Date], "31/12" ), -1, YEAR ),
            ALL ( 'Table'[GL CODE] )
        )
    )
)

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors