Forum Discussion

E_Rye's avatar
E_Rye
Frequent Visitor
6 months ago
Solved

Can rows be hidden from a Table visual without removing the rows from a measure shown in the Table?

Hello,

Is there a way to filter/hide rows in a Power BI table visual and keep the associated measure counts for those rows?

My table below summarizes a 36 month lookback for IDs which have a lifecycle.  The 'Active IDs During Reporting Month' column is a measure that counts IDs by 'Reporting Month' if "Active", including previous months.

 

Reporting Month                                Count of ID                    Active ID Count               

 

Active IDs

During Reporting Month          

Show Row       

1/1/202644601
12/1/202599591
11/1/20251010521
10/1/202577451
9/1/202544421
8/1/202588421
7/1/202577381
6/1/202511361
5/1/202533381
4/1/202522371
3/1/202555361
2/1/202544341
1/1/202566331
12/1/202464271
11/1/202433261
10/1/202444251
9/1/202433241
8/1/202444251
7/1/202433211
6/1/202411211
5/1/202422211
4/1/202433221
3/1/202444251
2/1/202466241
1/1/202465260
12/1/2023  220
11/1/202322280
10/1/202311280
9/1/202355310
8/1/202333260
7/1/202366240
6/1/202333180
5/1/202355160
4/1/202355110
3/1/20236560
2/1/20231110

 

My table visual needs to display 'Reporting Month' within the last 24 months (not including current month).

I created a flag for 'Reporting Month' more than 24 months from current = 'Include Row' but when I use it as a filter, the 'Active IDs...' count filters out the 'Reporting Month' where 'Include Row' = 0.  I also tried using 'Reporting Month' as a relative date filter (within the last 24 month), but that also removes the 'Active IDs...' count for the months filtered out (2/1/23-1/1/24)

 

What I am trying to achieve is for my table visual to display a 'Reporting Month' range = 1/1/26 - 2/1/24, where 'Active IDs...' = 25 for 'Reporting Month' = 3/1/24 and so on, as shown in the table above, while filtering/hiding the rows where 'Show Row' = 0  (2/1/23  - 1/1/24)

 

Thank you in advance for any help or suggestions you may have!

  • I have found the solution is to create a visibility flag measure to identify the rows that are within 24 months of the current date, as below, and then use that measure as a filter on the visual.  For some reason the visibility flag measure does not working for 'Filters on this page' but does work for 'Filters on this visual'.

     

    Within24Months (measure) =
    VAR CurrentDate = TODAY()
    VAR RowDate = MAX('Date'[Date])
    VAR MonthDifference = DATEDIFF(RowDate, CurrentDate, MONTH)
    RETURN
        IF(MonthDifference >= 0 && MonthDifference <= 24, 1, 0)

     

8 Replies

  • Hi,

    Shouldn't the number against 6/1/2023 under the "Active IDs During Reporting Month" column be 19 i.e. 16+3?  How did you calculate 18 there?  Also, the 24th month counted backward from 1/1/26 should be 2/1/24?  Therefore, shouldn't the answer be 24?  Lastly, is the input data the first 2 columns?

    • E_Rye's avatar
      E_Rye
      Frequent Visitor

      Hi Ashish_Mathur,

      For context, my 'Active IDs..' measure is dynamic to account for each ID having a "lifecycle".

      With respect to 6/1/23, 18 is the correct number as one ID has a "lifecycle" that began and ended 3/1/23 and another ID that began 4/1/23 and ended 5/1/23.  Does that make sense?

      Columns 2,3,5 are for validation and will be removed from final dashboard.

      Thank you very much for your time reviewing and replying!
      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        You are welcome.  I am still confused.  I do not know the result that you are expecting.

  • You can conditionally forma Show row to be transparent and replace the column name with a blank space.

    Use this measure as a field value in conditional formatting dialogue

    Transparent = "RGBA (0, 0, 0, 0 )"
    • E_Rye's avatar
      E_Rye
      Frequent Visitor

      Hi danextian,

      Am I understanding correctly that the "Transparent" measure used in the conditional formatting dialogue disappears the 'Show Row' column values?

       

      The 'Show Row' column is for context and will be removed from final dashboard but thanks for the cool trick! 

      • danextian's avatar
        danextian
        Super User

        It just makes it invisible in the visual but if the data is exported, it will be included.

  • E_Rye's avatar
    E_Rye
    Frequent Visitor

    I have found the solution is to create a visibility flag measure to identify the rows that are within 24 months of the current date, as below, and then use that measure as a filter on the visual.  For some reason the visibility flag measure does not working for 'Filters on this page' but does work for 'Filters on this visual'.

     

    Within24Months (measure) =
    VAR CurrentDate = TODAY()
    VAR RowDate = MAX('Date'[Date])
    VAR MonthDifference = DATEDIFF(RowDate, CurrentDate, MONTH)
    RETURN
        IF(MonthDifference >= 0 && MonthDifference <= 24, 1, 0)