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
BharathM
Helper IV
Helper IV

SamplePbix Uploaded filter same attribute with other slicer having same attribute

Hi Everyone
Hope every one doing well. I need your help Thanks in advance

SNIP 1

BharathM_0-1683195167025.png


Here my requirement is to filter only Delivery location and get the values as if the Base location is filtered

Eg: If i filter Del location of AKRON  i'm getting the results as below snip 

BharathM_1-1683195493905.png

 

 

But i'm trying to acheive the values of as in below snip 

BharathM_2-1683195614172.png


And the values should be as good as of if we filter base location i'm using Del Loction as slicer so whenever i select a specific
attribute in Del Location  it should work as if i had filtered base location

Note :i dont want add any new slicers i'm also posting the measure of distinct count used in this table

Distinctcount=

calculate(DISTINCTCOUNT('table'[DriverId]),
               GROUPBY('table','table'[BaseLocation],
                                                                    'table'[date])
                                                )     
The values I'm getting through above measure are correct 
Both Del Location and Base location are present in same table 



1 ACCEPTED SOLUTION

9 REPLIES 9
tamerj1
Super User
Super User

Hi @BharathM 
Probably @Greg_Deckler won't like this solution, I could not think of a simple no CALCULATE solution and I feel lazy as always 😅

Having one measure for both tables results in a wrong total as at the total level there is no way we can verify which column is placed in the visual therefore, I recommend splitting it into two measures following the 2nd screenshot.

4.png3.png

Hi @tamerj1  Thank you so much for replying me

Its working half of my requirement 
Here before selecting the location AKRON in the delivery location Slicer the values of baselocation are 8 

The highlighted red box values I need

BharathM_3-1683270180167.png

 


After selecting the AKRON the values of AKRON are changing i'm expecting the value 8

I need the values visable in red box baselocation in above snip
After selecting also need the same values

BharathM_2-1683269993528.png

 

Note: I will remove the delivery location table visual i dont want that
only the problem here is filter and the values 


@BharathM 

Try this

Distinct count =
IF (
ISFILTERED ( data3[DeliveryLocation] ),
CALCULATE (
DISTINCTCOUNT ( data3[DriverId] ),
KEEPFILTERS (
TREATAS ( VALUES ( data3[DeliveryLocation] ), data3[BaseLocation] )
),
ALLEXCEPT ( data3, data3[BaseLocation] )
),
DISTINCTCOUNT ( data3[DriverId] )
)

Totals are incorrect 

BharathM_0-1683275850980.png


I changed the measure as below and totals are correct now
Please confirm me does it cause any problem with the below measure

BharathM_0-1683276094141.png

 

 

@BharathM 
Here are 2 solutions

4.png3.png

Hi @tamerj1 

It created one more problem for me when I'm using Drill Through of Delivery Location
AKRON in the new measure i'm not getting the values of 8 
Again I'm getting value of AKRON is 7(wrong)

without drill through when i filter in Delivery Location measure is working

It missing when using drill through

@tamerj1 

I know you are brilliant Thank you so much....... It's working

Greg_Deckler
Super User
Super User

@BharathM Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler @tamerj1 
Here is Sample Pbix file 

Thanks for Quick respone 

DelLocation_slicer.pbix

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.

Top Solution Authors