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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Nullify values after last YTD observation

Dear Community,

 

I have made a graph showing Revenue and Budget using a YTD calculation. However, after my last observation, the YTD assumes my values to be constant and not nullifying them.

 

How can i make a graph that shows the actual revenue YTD as it is, but giving a value of 0 or null after my latest actual revenue available?

 

Here below you find the formula and screenshots.

 

FORMULA for YTD:

 

Rev. YTD Actuals = TOTALYTD(
SUM('Raw Data'[Total RevActual]);'Raw Data'[Fiscal year/period])

 

cap1.PNGcap2.PNG

 

 

In the "edit query" tab

cap3.PNGcap4.PNG

3 REPLIES 3
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

You may try to use IF Function. For example:

 

Measure =
IF(SUM('Raw Data'[Total RevActual])=0,0,[Rev. YTD Actuals])

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi,

 

It doesn't work.

 

Could you please insert full formula.

 

Current:

Rev. YTD Actuals = TOTALYTD(SUM('Raw Data'[Total RevActual]);'Raw Data'[Fiscal year/period]) 

 

I tried:

 

Rev. YTD Actuals = IF(TOTALYTD(
SUM('Raw Data'[Total RevActual]);'Raw Data'[Fiscal year/period])=0;0;TOTALYTD(SUM('Raw Data'[Total RevActual]);'Raw Data'[Fiscal year/period]))

 

but nothing changes.

Hi @Anonymous

 

You may also try below measure. If it is not your case, please share a simplified data sample.

 

Rev. YTD Actuals = TOTALYTD(SUM('Raw Data'[Total RevActual]);'Raw Data'[Fiscal year/period]) 

Measure =
IF (
    CALCULATE (
        [Rev. YTD Actuals],
        FILTER (
            ALL ( 'Raw Data' ),
            'Raw Data'[Fiscal year/period] < MAX ( 'Raw Data'[Fiscal year/period] )
        )
    )
        = [Rev. YTD Actuals],
    0,
    [Rev. YTD Actuals]
)

Regards,

Cherie

 

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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