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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
nalakanayana
Frequent Visitor

DAX concepts / Filter behaviour

I am having question which i didn't think before,but i am not sure the way i think is correct.

Scenario 01

I am having three tables(company,customer and fact table called tnx) ,total Ar amount is just sum of tnx.I have a relationship to company to fact and customer to fact as star schema.

When i select company code from company table as slicer,  total is changing .that is obvious,but how customer figures are changing cos there is no direct relationship with company and customer and direction is also uni directional .Is that company filter fact table and then as reverse filter, fact table filter out customer. Ijust want to know the way i think is correct.Customer is indirectly filter by company via fact as i understood.

nalakanayana_2-1695793174927.png

 

nalakanayana_1-1695793158895.png

Scenario 02

nalakanayana_3-1695793198322.pngnalakanayana_4-1695793205026.png

This uses also same three tables ,customer company and fact .Here i rank amount based on customer parent id (1 st column)
The DAX i used =

var _step1 =
IF (
    ISINSCOPE ( CUSTOMERS[CUSTOMER_PARENT_ID_REPORTING] ),
    IF (
        HASONEVALUE ( CUSTOMERS[CUSTOMER_PARENT_ID_REPORTING] ),
        RANKX (
            ALLSELECTED ( CUSTOMERS[CUSTOMER_PARENT_ID_REPORTING] ),
            CALCULATE (
                [Total AR Amount],
                ALLEXCEPT ( CUSTOMERS, CUSTOMERS[CUSTOMER_PARENT_ID_REPORTING] )
            ),
            ,
            DESC,
            DENSE
        )
    )
)
 
So I get the values as in 6 th column and 7 th column is just sum(amount) as 1st scenario. What i am going to achieve is customer parent level ranking based on amount.But what happen if i slice by company code.Company code column is not on visual
But when i click company code slicer for a particular company code i can see value changes also parent id changes.But the DAX, i wrote to calculate [Total AR Amount] i wrote with ALLEXCEPT,so it remove all filters except Customer parent id.
But since i have used allselected for customer_parent _id reporting now how this flows goes on.This is difficult to understand how this is behaving now with rank.I am not sure the final answer i am getting is right.what i finally want is dynamcially rank based on external slicers and show the total based on customer parent

Can you all help me with this.

 

1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors