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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
DavidGM
Helper I
Helper I

Trying to create OR slicer between two columns (Team and Shared Team)

            NAME       Team            Shared Team        Hours

1AlexIntegrationMain Integration2
2Alex Main Integration3
3AlexIntegration 2
4JamieIntegrationMain Integration2
5JosephSecuritySecurity Team1
6SmithDevelopmentCustom Develop2
7Smith Custom Develop2
8DeanTestingTesting Team4
9Dean Testing Team1
10William DatabaseTesting Team3
     
I like to see hours worked by Team Or shared team field so I can see how much 
work individual assignee is working. So I can filter on team or shared team from 
the single list (Team + shared team becomes one column). OR Slicer
6 REPLIES 6
FreemanZ
Super User
Super User

Hi @DavidGM 

 

You would need the two slicers from two different tables, like below:

 

1) The model:

FreemanZ_0-1668347979055.png

(Hint: the two dimensional table can be duplicated from the Data table in Power Query)

 

2) The result:

FreemanZ_1-1668348067214.png

 

3) The code for the measure:

 

TotalHours =
VAR _table1 =
CROSSJOIN (
    ALL(Team[Team]), VALUES('Shared Team'[Shared Team])
)
VAR _table2 =
CROSSJOIN (
   VALUES(Team[Team]),ALL('Shared Team'[Shared Team])
)
VAR _table3 =
UNION (_table1, _table2)
RETURN
    CALCULATE (
    SUM(Data[Hours]),
    _table3
)

Thanks, I like to understand that model a bit better. As Team (coming from Main Table) and Shared Team (coming from Effectiveness table ), Hours (comig from Main Table) and these tables already have relationship. So you suggesting I should break the relationship between them? As I tried that measure it still gives me AND values. Thankyou!

Indeed it hides some complexity. The point is the two fields you put to slicer need to be independent from each other, so comes the need to break the relationship of the two sliced fields. Otherwise when you make a selection at one, the other changes accordingly. So you need at least three tables in your model: one record table(for the Hours value) and two dimensional table (for the slicers) .

Mikelytics
Resident Rockstar
Resident Rockstar

Hi @DavidGM 

 

my start table

Mikelytics_0-1668293917177.png

 

if you have emtoy fields which are not null do the following

 

Trim

Mikelytics_3-1668294072209.png

 

Replace "" with null

Mikelytics_1-1668293969554.png

Mikelytics_2-1668293991697.png

 

in between result:

Mikelytics_5-1668294134241.png

 

 

now fill down

Mikelytics_6-1668294165235.png

 

Mikelytics_7-1668294182056.png

 

Now add a column

Mikelytics_8-1668294226440.png

Mikelytics_10-1668294330608.png

 

 

if Text.Trim([Shared Team]) = "" or [Shared Team] = null then [Team] else [Shared Team]

 

 

Now delete the old Shared Team column

Mikelytics_13-1668294382971.png

Mikelytics_15-1668294393799.png

and rename the new one from "SHared Team New" to "Shared Team"

Mikelytics_16-1668294427454.png

now you have cleansed both columns

Mikelytics_17-1668294455054.png

 

you can also combine the two columns in one column

Mikelytics_18-1668294591965.png

[Team] & "-" & [Shared Team]

Mikelytics_19-1668294635948.png

 

 

 

 

Best regards

Michael

-----------------------------------------------------

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

@ me in replies or I'll lose your thread.

 

 

 

 

 

 

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

Thanks, but now if I like to use the filter Integration, will that show me data from Combined column ?

@DavidGM 

 

I am not sure what you want to do but you could take a table visual and put the "combined" field in there. Then you take two slicers. IN one slicer you put the "Team" column and in the other slicer you put the "Shared Team" slicer.

 

table visual for "Combined" field

Mikelytics_0-1668324148023.png

 

two slicer for "Team" and "Shared Team"

Mikelytics_1-1668324212305.png

 

Best regards

Michael

-----------------------------------------------------

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

@ me in replies or I'll lose your thread.

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.