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
Anonymous
Not applicable

MTD Returning YTD Value in Cell

Hi,

 

I am creating a report using an excel file. It is straightforward enough. I just need to calcuate MTD, YTD and the variances between both for range of different years.

 

I have used these calculations before using quick measures and they worked perfectly. However my MTD Calculations are returning YTD if there is no MTD Value. The Total Calculation at the end is correct but the cells are not. In the first column my calculation works but it is a column not a measure so it has limitations.

 

Totalimage.png

Has anyone seen this before or know why it is occuring?

 

This is the calculation for my Column

SalesMTD =
IF( AND
        (AND(
              ('Item Ledger Entries'[Posting Date].[MonthNo]=(MONTH(TODAY()))),
              ('Item Ledger Entries'[Posting Date].[Year] = YEAR(TODAY()))),
       ('Item Ledger Entries'[Posting Date].[Date] <= TODAY())) ,
'Item Ledger Entries'[Sales Amount (Actual)],
BLANK())
 
This is the calculation for my MTD Measure
Sales Amount (Actual) MTD =
IF(
    ISFILTERED('Item Ledger Entries'[Posting Date]),
    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
    TOTALMTD(
        SUM('Item Ledger Entries'[Sales Amount (Actual)]),
        'Item Ledger Entries'[Posting Date]  //(Have tried this with .[Date] at the end but that returns blanks)
    )
)
0 REPLIES 0

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.