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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Paulyeo11
Impactful Individual
Impactful Individual

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

@Paulyeo11 , 

 

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 @Paulyeo11 ,

 

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

Hi @Paulyeo11 ,

 

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

Hi Sir

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

Paul

@Paulyeo11 , 

 

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!




Hi Mani

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

Paul

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 @Paulyeo11 ,

 

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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