Forum Discussion

GilbertQ's avatar
GilbertQ
Icon for Super User rankSuper User
9 years ago
Solved

Get LastNonBlank Value across all rows

Hi there I wonder if someone could help me out.

 

If you can refer to the image below.

 

What I want is the Value from the ZCALC Rowz (30/06/2019) to be repeated. As is shown the the example in the ZCALC ROwz column (1/07/2020)

 

The trick here is that I have got a Fiscal Year Slicer, so if I click on Fiscal Year 2019-20 then I want the repeated value to change from 30/06/2019 to be 30/06/2020 for all the rows in the table.

 

Any help or suggestions will be appreciated.

 

  • GilbertQ's avatar
    GilbertQ
    9 years ago

    Hi tringuyenminh92 I managed to figure it out

     

    Here is the code that I used to return to me the values selected from the Fiscal Year Slicer

     

    ZCALC ROwz2 =
    CALCULATE (
        CALCULATE ( COUNTROWS ( 'TYOY' ), ALLSELECTED ( 'Date'[Fiscal Year] ) ),
        ALLSELECTED ( 'Date' )
    )

4 Replies

  • Hi GilbertQ,

     

    I'm sorry but i'm trying to understand your case correctly. Could you please provide the picture of whole report you want and data table with Fields in chart? If there is no sensitive information, you could share current pbix file. So I could quicky understand and help you.

    • GilbertQ's avatar
      GilbertQ
      Icon for Super User rankSuper User

      Hi tringuyenminh92 I managed to figure it out

       

      Here is the code that I used to return to me the values selected from the Fiscal Year Slicer

       

      ZCALC ROwz2 =
      CALCULATE (
          CALCULATE ( COUNTROWS ( 'TYOY' ), ALLSELECTED ( 'Date'[Fiscal Year] ) ),
          ALLSELECTED ( 'Date' )
      )

      • tringuyenminh92's avatar
        tringuyenminh92
        Icon for Memorable Member rankMemorable Member

        It's good to hear that. Another way to get current selected in slicer is using FirstNonBlank( Values( filter column),1)