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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.