Forum Discussion

powerbinoobster's avatar
3 years ago
Solved

Stop Line Graph from extending after the last data point?

I created a measure that calucales the running toal of my data.

Count of Status YTD = 
IF(
	ISFILTERED('ECO'[Date Originated]),
	ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
	TOTALYTD(COUNTA('ECO'[Status]), 'ECO'[Date Originated].[Date])
)

 

But, the line graphs keep extedning after the current mont(Last data). How would I stop this so the line only goes till the current month 

  • Hey VahidDM,

     

    Your solution was almost there. You missed  the .[DATE] in the last IF. Also, if I have data in the month of septemebr, my line graph would stop at August. So what I did was add +30 to TODAY() and now it includes the data for septemeber. 

     

    Count of Status YTD =
    VAR _A =
    IF (
    ISFILTERED ( 'ECO'[Date Originated] ),
    ERROR ( "Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column." ),
    TOTALYTD ( COUNTA ( 'ECO'[Status] ), 'ECO'[Date Originated].[Date] )
    )
    RETURN
    IF ( MAX ( 'ECO'[Date Originated].[Date] ) > TODAY() + 30, BLANK (), _A )

2 Replies

  • Hi powerbinoobster 

     

    Check this code:

    Count of Status YTD =
    VAR _A =
        IF (
            ISFILTERED ( 'ECO'[Date Originated] ),
            ERROR ( "Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column." ),
            TOTALYTD ( COUNTA ( 'ECO'[Status] ), 'ECO'[Date Originated].[Date] )
        )
    RETURN
        IF ( MAX ( 'ECO'[Date Originated] ) > TODAY (), BLANK (), _A )
    

     

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

    Appreciate your Kudos!! 

    LinkedIn | Twitter | Blog | YouTube 

    • powerbinoobster's avatar
      powerbinoobster
      Icon for Helper I rankHelper I

      Hey VahidDM,

       

      Your solution was almost there. You missed  the .[DATE] in the last IF. Also, if I have data in the month of septemebr, my line graph would stop at August. So what I did was add +30 to TODAY() and now it includes the data for septemeber. 

       

      Count of Status YTD =
      VAR _A =
      IF (
      ISFILTERED ( 'ECO'[Date Originated] ),
      ERROR ( "Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column." ),
      TOTALYTD ( COUNTA ( 'ECO'[Status] ), 'ECO'[Date Originated].[Date] )
      )
      RETURN
      IF ( MAX ( 'ECO'[Date Originated].[Date] ) > TODAY() + 30, BLANK (), _A )