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
Anonymous
Not applicable

Countrows with filters from current table applied only

Update: I've found a different way to organize my data, so I don't need this anymore

Hi,

 

Here's my PBI report with sample data: https://www.dropbox.com/s/9k0fth7qed7t33n/sample%20data.pbix?dl=0

 

So, here's the full set of data:

zaminamina_0-1647319888489.png

'Country of origin' comes from the 'Master Data' table (attribute table), while the other values come from the '2 Snacking Occasion' table. 

This is the model view:

zaminamina_1-1647319955977.png

My entries measure is simply a countrows of the 'master data' table.

% measure =
DIVIDE(
'Master Data'[Entries],
CALCULATE(
COUNTROWS('Master Data'),
ALLCROSSFILTERED('Master Data')
)
)
 

What I'm trying to get is if I have a slicer (field will be from master data table) applied, say for example, 'Europe & Americas' chosen for 'country of origin', the % by value should display as 80% (4 divided by 5) for the afternoon snacking category.

zaminamina_2-1647320208724.png

Basically the denominator portion of the divide function should count rows for all entries in the master data table without the filters from the '2 Snacking Occasion' table being applied.

 

This should work for all attributes chosen, e.g. gender, age, city, etc.

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, I've actually added an update to my post. I've found a different workaround in my dataset, so I no longer need an answer to this. Thanks for looking into it though!

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Try like

 

% measure =
DIVIDE(
[Entries],
CALCULATE(
COUNTROWS('Master Data'),
all('2 Snacking Occasion' )
)
)

Anonymous
Not applicable

Nope, that doesn't work. 😞 Still get the same values...

@Anonymous , The file is nor available at given link


Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Anonymous
Not applicable

Hi, I've actually added an update to my post. I've found a different workaround in my dataset, so I no longer need an answer to this. Thanks for looking into it though!

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.