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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
SEunson
Frequent Visitor

View rows counted in CountX function

Hi all, I have a measure which counts the number or rows in a table, depending on a condition e.g.

COUNTX(

    TableA,

     IF(

        AND(

            TableA[Start Date] <= [Month End],

             ISBLANK(TableA[End Date]) || TableA[End Date] >= [Month Start]

         ),

        TableA[ID]

    )
)

 

These results are then shown on a line graph, with month on the x axis.

 

I would like to visualise the rows that have been counted in a table, so I can see further details on the counted rows.

 

Drill though does not work because the rows counted for a specific month do not necessarily fall within that month.

 

Does anyone have any suggestions?

Thanks!

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Create a new measure like 

Is Visible = IF( 
SELECTEDVALUE('TableA'[Start Date]) <= [Month End] &&
( SELECTEDVALUE('TableA'[End Date]) >= [Month Start] || ISBLANK(SELECTEDVALUE('TableA'[End Date])),
1)

then use that as a filter on your table visual to only show rows when the value is 1

View solution in original post

3 REPLIES 3
SEunson
Frequent Visitor

Hi, I tried your suggestion out. I can't get it to work as a filter. But if I put the new measure in a table along with the other fields I want to see, it seems to work ok then. I'm not too sure why that is... but anyway, it's better than I had before, so thanks.

SEunson
Frequent Visitor

Hi johnt75,
Thanks for the response. I'll have a look into this. Will let you know how I get on.

johnt75
Super User
Super User

Create a new measure like 

Is Visible = IF( 
SELECTEDVALUE('TableA'[Start Date]) <= [Month End] &&
( SELECTEDVALUE('TableA'[End Date]) >= [Month Start] || ISBLANK(SELECTEDVALUE('TableA'[End Date])),
1)

then use that as a filter on your table visual to only show rows when the value is 1

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.