Forum Discussion

Kayla2020's avatar
Kayla2020
Frequent Visitor
2 years ago
Solved

Filter to disconnected tables.

Hi everyone,

I am quite new to DAX formulas and I would appreciate your support on this.

I have a matrix table based on dept and cost. There are two disconnected tables(based on project) used in the matrix to return dept costs for selected projects. The image below shows the matrix is filtered based on the selection of the disconnected tables. In the screenshot below, the country and cluster slicers have no interaction with the disconnected tables.

I created two DAX formulas to return cost for selected projects 1 and 2 in the matrix.
cost_project1



cost_project2


Data model

 

I want to create a slicer for country and cluster to filter the disconnected tables i.e if a country and cluster are selected, the disconnected tables return projects available in the selected country and cluster. 

Please how do I achieve this? Find attached the file below.

Thank you.


project

dept

cluster

country

cost

Project A

HR

1

France

5700

Project b

Logistics

1

Poland

7487

Project c

Product design

2

France

7207

Project d

Transport

1

Turkey

7374

Project e

HR

1

UK

13018

Project f

Logistics

2

Poland

10117

Project g

Product design

2

Turkey

6348

Project g

Transport

2

France

8902

Project h

HR

1

Poland

6061

Project j

Logistics

2

France

10677

Project i

Product design

3

Turkey

6952

Project k

Transport

3

UK

7970

Project f

HR

1

Poland

10940

Project n

Logistics

2

Turkey

6979

Project m

Product design

1

Turkey

11587

 

  • Hi, Kayla2020 

     

    You can try the following methods.

    Measure = 
    Var _table=UNION(CALCULATETABLE(Slicer_1),FILTER(Slicer_1,[project]=SELECTEDVALUE(Slicer_1[project])),CALCULATETABLE(Slicer_2),FILTER(Slicer_2,[project]=SELECTEDVALUE(Slicer_2[project])))
    Return
    IF(SELECTEDVALUE(Facts_table[project]) in _table,1,0)

    Place measure in the filter of the view to be filtered and set it equal to 1.

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • We want to help you but your description is too vaugue. Please write it again clearly.

    You say are a Power BI novice so please DON'T copy & paste your reports that does not work and expect us to fathom what you want to do. Also dont got into long detail of what does noit work. That is a bit crazy. 😀

    Please just give a concise simple non technical functional decscription of what you want, then let us suggest the solution. Thank you.

    Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.
    Also provide the example desired output, with a clear description of the process flow.
    Remember not to share private data ... we don't want you to get into trouble. 😧
    Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you.
    Try keep it simple and ask one question per ticket.
    You will get a quick response if you put time, care and effort into writing clear problem descriptions.

    Vaugue descriptions can waste your time and ourtime.

    Look foward to helping you when the above information is forthcoming

    • Kayla2020's avatar
      Kayla2020
      Frequent Visitor

      Thank you for your response speedramps

      I am trying to compare dept cost between two projects in the same location.

      What I did - I created two disconnected tables for the selection of the projects and created measures based on these tables.

      What I am trying to achieve - I want to apply country and cluster slicers as filters to the disconnected tables so that if a country and cluster are selected, the disconnected table slicers return projects in the selected country and cluster. This would enable me to select projects based on the same location and cluster.

      Please find attached the pbix file.

      Thanks.

      Disconnected tables 

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, Kayla2020 

     

    You can try the following methods.

    Measure = 
    Var _table=UNION(CALCULATETABLE(Slicer_1),FILTER(Slicer_1,[project]=SELECTEDVALUE(Slicer_1[project])),CALCULATETABLE(Slicer_2),FILTER(Slicer_2,[project]=SELECTEDVALUE(Slicer_2[project])))
    Return
    IF(SELECTEDVALUE(Facts_table[project]) in _table,1,0)

    Place measure in the filter of the view to be filtered and set it equal to 1.

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.