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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
GKK1
Helper II
Helper II

Urgent Help require please - 1 slicer to filter 2 columns.

Hi Power Bi Community,

Hi @v-junyant-msft , 

I would really appreciate your help. 
I have two sicers, one is Opertational deparment and the other is Departments. And If I select Gift Card from my Department slicer then it will give me the worked hours against Gift Card and all the Sales in different Sales departments against the Gift Card as well. 

Similar results for the Credit Card department.

Thanks in advance for your support.

My Data model:

GKK1_0-1703439650301.png

 

The Data looks like this:

GKK1_3-1703439913217.png

 

My operational slicer is working fine, if I select any of it then it gives me Sales and Work force hours as expected:

GKK1_2-1703439808479.png

Now I want to use my Department Slicer to work in a way that it will filter two columns, the Departments and Operational Departments both at the same time if I select one. Currently, department slicer is not working as I want it to work. If I am selecting Credit Card, then it is showing me only the data in Work hours and no sales against the Credit Card in any department. As shown in the screen shot.

GKK1_4-1703439963791.png

I want to see the results as follows with the Department Slicer.

Department Slicer
Gift Cards

If I select Gift Card from Slicer then I should see these results. To me it seems like I have one department slicer which will filter one column from work force hours table and two columns from Sales , i.e. Departments and Operational Departments both.
Results :

Work force DeptOp    DeptWork Hours
Gift CardsGift Cards45



Sales DeptOp DeptSales Dollars
Kid's clothingGift Cards6000
Men's ClotingGift Cards6000
Wommen's ClothingGift Cards4500
ToysGift Cards4000
CosmeticsGift Cards5000
ElectronicsGift Cards3500
Home DécorGift Cards4500
3 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Anonymous
Not applicable

Hi @GKK1 ,

Replace "Values" in the matrix with the following two measures:

Sum_of_Sales_Dollars = CALCULATE(
    SUM('Sales Hours'[Sales Dollars]),
    FILTER(
        'Sales Hours',
        'Sales Hours'[Measure] = 1
))
Sum_of_Work_Hours = 
CALCULATE(
    SUM('Work Force Hours'[Work Hours]),
    FILTER(
        'Work Force Hours',
        'Day'[Measure2] = 1
    )
)

vjunyantmsft_0-1703552976117.png


The results are as follows:

vjunyantmsft_1-1703553009579.png

 

vjunyantmsft_2-1703553020051.png

 

vjunyantmsft_3-1703553029741.png

 

vjunyantmsft_4-1703553043572.png

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

View solution in original post

Anonymous
Not applicable

Hi @GKK1 ,

Please check whether this is what you want?

Best Regards,
Dino Tao

View solution in original post

21 REPLIES 21
Anonymous
Not applicable

Hi @GKK1 ,

Please try this way:
First of all, please set the relationship like this:

vjunyantmsft_0-1703468670235.png

Then create a new measure by using the DAX below:

Measure = 
VAR Selected = SELECTEDVALUE(Sheet3[Hours Depoartment Slicer])
RETURN
IF(
    Selected = "Credit Card" || Selected = "Gift Cards",
    IF(
        SELECTEDVALUE('Sales of the store'[Op Dept]) = Selected, 1, 0),
        IF(
            SELECTEDVALUE('Sales of the store'[Sales Dept]) = Selected, 1, 0)
)

Click on the visual object and put the measure into "Filters on this visual":

vjunyantmsft_1-1703468938321.png
vjunyantmsft_2-1703468977006.png

The results are as follows:

vjunyantmsft_3-1703469019024.pngvjunyantmsft_4-1703469033823.pngvjunyantmsft_5-1703469043042.png


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

Anonymous
Not applicable

 

thanks but it is not working completely. It broke the Operational departments a bit. I can't see Cash in the sales for Op_department slicer:

GKK1_0-1703470807060.png

And untill I do not select any department I cant see anything from the sales data. I want if I do not have anything selected from the slicer, all the data is shown. 

GKK1_1-1703470895421.png

With no selected the results should be everything like this. 

GKK1_2-1703470931481.png

 

Anonymous
Not applicable

Hi @GKK1 ,

Oh sorry I forgot another slicer, please change the DAX into this:

Measure = 
VAR Selected = SELECTEDVALUE(Sheet3[Hours Depoartment Slicer])
RETURN
IF(
    ISBLANK(Selected),
    1,
    IF(
    Selected = "Credit Card" || Selected = "Gift Cards",
    IF(
        SELECTEDVALUE('Sales of the store'[Op Dept]) = Selected, 1, 0),
        IF(
            SELECTEDVALUE('Sales of the store'[Sales Dept]) = Selected, 1, 0)

)
)

Nothing else needs to change.

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

Thank you very much, it is working with this DAX measure. Just one last thing please.  As shown in the screenshot, if I select a Department for example Cosmetics and then select Credit Card as well, then it is showing me all the Credit Cards and not the Credit Card just from the Cosmetics. Which should be kind of the behaviour of the slicer if we select multiple slicers at the same time.

GKK1_0-1703476817745.png

 

Anonymous
Not applicable

Hi @GKK1 ,

Start by adjusting the relationship as shown below:

vjunyantmsft_0-1703483559882.png

With the above DAX and all operations preserved, add a measure2 to the Employee hours table:

Measure2 = 
VAR Selected = SELECTEDVALUE(Sheet3[Hours Depoartment Slicer])
RETURN
IF(
    ISBLANK(Selected),
    1,
    IF(
       SELECTEDVALUE('Employee hours'[Work force Dept]) = Selected,
       1,
       0
)

vjunyantmsft_1-1703483715749.png

The results are as follows:

vjunyantmsft_3-1703483754393.png

 

vjunyantmsft_4-1703483763309.pngvjunyantmsft_5-1703483770394.pngvjunyantmsft_6-1703483781569.png

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

Thank you very much, I really really appreciate. And sorry to bother you again. 
My client asked me show this data in a matrix as well on the next tab in the report on daily basis. 
This is working with the Op departments 100% because we do have relationship there. But not with the departments. I am sharing the screenshot and the file with added Day table.

GKK1_0-1703537671545.png

GKK1_1-1703537791847.png

https://drive.google.com/file/d/1mguXi5Xw2r_4rrhkCl_W8x9yp-Udm9Zc/view?usp=drive_link 

Anonymous
Not applicable

Hi @GKK1 ,

Replace "Values" in the matrix with the following two measures:

Sum_of_Sales_Dollars = CALCULATE(
    SUM('Sales Hours'[Sales Dollars]),
    FILTER(
        'Sales Hours',
        'Sales Hours'[Measure] = 1
))
Sum_of_Work_Hours = 
CALCULATE(
    SUM('Work Force Hours'[Work Hours]),
    FILTER(
        'Work Force Hours',
        'Day'[Measure2] = 1
    )
)

vjunyantmsft_0-1703552976117.png


The results are as follows:

vjunyantmsft_1-1703553009579.png

 

vjunyantmsft_2-1703553020051.png

 

vjunyantmsft_3-1703553029741.png

 

vjunyantmsft_4-1703553043572.png

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

Hi @Anonymous ,

 

I have another really urgent request. Now my client wants me to optimize the slicers into one. So I need to have just the operational departments as the slicers and in the Cash Departments they want to see all the other common departments. The function will remain kind of the same except the Cash operations department will have drop down menu with those cash departments and show only the results with those. We have the PBI file attahced in the chat history and the required results would be:

SlicerResult valuesDrop Down Slicer
Credit CardCredit Card 
Gift CardGift Card 
SupportSupport 
CashCash Cosmetics
  Electronics
  Home Decore
  Kid's Clothing
  Men's Clothing
  women's Clothing
  Toys


I would really really appreciate a quick help here.

 

Best reagrds,

GK

Anonymous
Not applicable

Hi @GKK1 ,

If you want all but the cash department to just see this part of the slicer and the corresponding content:

vjunyantmsft_0-1704328134088.png

And only the cash department can see this part of the drop-down menu and the corresponding content:

vjunyantmsft_1-1704328189474.png

I'm sorry, but this is not available in Power BI at this time. I could probably implement this slicer using the method of setting up the RLS, but then the information captured by all but the cash department would be crippled (even what they should be able to see may not be visible).

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

@Anonymous  Is it possible to have the results like this:

SlicerResult valuesDrop Down Slicer
Credit CardCredit CardCredit Card
Gift CardGift CardGift Card
SupportSupportSupport
CashCash Cosmetics
  Electronics
  Home Decore
  Kid's Clothing
  Men's Clothing
  women's Clothing
  Toys

 

And the result values for work force hours and Sales dollars will be the same as we had earlier that if I select Credit Card then it will have the hours against the credit card and Sales dollars against the Credit Card, same with Gift Card.
But when I select Cash, then the slicer will show me all the other options and if I select CASH from slicer then it will show me all the values, however, if I want I would be able to select just one Department under Cash and would be able to see that department's Sales dollars and work Hours.

Best regards,

GK

Anonymous
Not applicable

Hi @GKK1 ,

I'm sorry to say that this really isn't possible. I've tried, and in any case to achieve the result you need you need at least two slicers

Best Regards,
Dino Tao

@Anonymous , thanks for checking.
Would it be possible to reduce redundancy, that I will use only one Departments Slicer. And the results would be that if I select Electronics then I will get same results from Work hours Data but in the Sales I will get the results only from Cash Sales and it will filter out Sales from the Credit Card and Gift Cards from the Table and the matrix both? The Total should be $4500 only which is from Cash. We have Credit Cards and Gift Cards covered separately in the Departments for Sales , and that should remain the same.

GKK1_0-1704335854430.png

 

Anonymous
Not applicable

Hi @GKK1 ,

Please check whether this is what you want?

Best Regards,
Dino Tao

@Anonymous , yes it is. Thank you very much once again. Really appreciate once again. I have seen that you have added in the Measure to get the results.

Measure =
VAR Selected = SELECTEDVALUE(Departments[Departments])
RETURN
IF(
    ISBLANK(Selected),
    1,
   IF( Selected = "Credit Card" || Selected = "Gift Cards" ,
    IF(
        SELECTEDVALUE('Sales Hours'[Op Dept]) = Selected, 1, 0),
        IF(
            SELECTEDVALUE('Sales Hours'[Sales Dept]) = Selected && SELECTEDVALUE('Sales Hours'[Op Dept]) = "Cash", 1, 0)

Thank you very much @Anonymous . I really appreciate all of your support. I would really love to learn Power BI DAX from you more in the future. 🙂

Anonymous
Not applicable

 
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data 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.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Thank you very much @lbendlin for your guidance.

Here is the link to the sameple file. https://drive.google.com/file/d/1mguXi5Xw2r_4rrhkCl_W8x9yp-Udm9Zc/view?usp=drive_link 

The results I want that if I will select Credit Card from the department, then my tables will show me the all the departments where payment mode in Sales table is Credit Card and the worked hours from Credit Card department. As underlined in the screen below.

GKK1_0-1703467906427.png

I have Sales Departments and Work Hours Departments mapped so that if I will select any department it will show me the hours and sales both from the same department. 
The issue is where I have the same Operational departments name in the Work Hours department. i.e. Credit Card and Gift Card.

Please let me know if it clarifies my question. I would really appreciate your support to resolve this issue. Thanks

please check the link - access is denied.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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