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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sbatool
Helper I
Helper I

Dynamic row count of a table that gets data from a drillthrough on a separate report

Hi everyone,

Can someone please help with regards to a dynamic row count of a table visual that gets its data as a result of a drillthrough?

Currently, I'm testing this functionality with cross-drillthrough. The requirement is to have two separate reports (source and target) with cross-drillthrough enabled. In the source report, we have disabled export, whereas in the target report we want to enable export to limit the number of data exports.
In the target report, we want to use a simple table visual that captures the values of the drillthrough fields, keeping all filters. Is there a way to show the number of rows in that table dynamically in a card based on whatever filters users apply in the source report so that users in the target report know how many rows they're going to export?

3 REPLIES 3
amitchandak
Super User
Super User

@sbatool ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

I have got it to work now using the following sample code.
The variable FilterCheck identifies if any of the following columns from the relevant dimensions are not filtered (from the source report). If any of these columns are filtered, then the variable EmployeeCount will count the number of employees in the fact table accordingly. 

Employee Row Count =
VAR FilterCheck =
IF (
NOT (
ISFILTERED ( 'Management Structure'[Business] )
|| ISFILTERED ( 'Management Structure'[Region] )
|| ISFILTERED ( 'Management Structure'[Organisation] )
|| ISFILTERED ( 'Business Group'[Business Group])
|| ISFILTERED ( 'Employee'[Employee] )
|| ISFILTERED ( 'Currency'[Currency Name])
),
1,
0
)
VAR EmployeeCount = SWITCH ( TRUE (), FilterCheck = 1, 0, DISTINCTCOUNTNOBLANK('Fact'[Employee No]))
RETURN
EmployeeCount
The result is displayed in the Target report in the form of a message that uses this Employee Row Count measure. 🙂

@amitchandak, Thanks for getting back on this post.
Here's what we have in the source report:

- Filters for Region, Organisation, Business Group, Employee, Period, Currency etc.

- A matrix visual that contains Region, Organisation, Business Group and Employee on row level, and metrics on column level. 

  • Region and Organisation are coming from Management structure dimension table.
  • Business Group is coming from Business Group dimension table.
  • Employee is coming from the Employee dimension table.

(In the Power BI model, these dimension tables are joined to the employee utilisation fact table.)

When a user right clicks on any of the Region/Organisation/Employee from this matrix, and chooses Drill through [Export Page], they need to be redirected to the target page on a Target report.

In the Target report, we need to show those all of those matrix attributes as above with their values inside a table visual. Up to this point, I have worked out fine. 

The challenge now for me is to show a text message saying "You are going to export [N] number of rows". How do I figure out the number of rows inside that table visual dynamically? Because the number of rows in the Target report may change each time a user filters something in the Source report and applies drill through. 

Please let me know if that clarifies the problem.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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