Forum Discussion

timhopson's avatar
timhopson
Helper I
3 years ago
Solved

Create a table that is a subset or another table, using a visual slicer

Hi, 
I have this table:
 
OrderSummary =
Company, 
NumberOfOrders,
ValueOfOrders,
TypeOfCompany
 
 
I want the user to select the company from a slicer, and display data in a matrix, similar to this...
 
 
NumberOfOrders 100
ValueOfOrders £123,456
TypeOfCompany   Insurance
 
 
I hoped I could create a calculated table , such as:
 
FilteredCompany = 
UNION (
ROW ("Field", "Number of Orders", "Value", sum(NumberOfOrders) ),
ROW ("Field", "Value of Orders",  "Value", sum(ValueOfOrders) ),
ROW ("Field", "Type Of Company", "Value", selectedValue(TypeOfCompany, "multiple") )
       )
 
and then display Field and Value in a matrix.
 
I have added a slicer to the page, however the FilteredCompany doesn't get filtered. 
 
Is there a way I can get this data to just show the data selected by the user?

4 Replies

  • ppm1's avatar
    ppm1
    Solution Sage

    Calculated tables and columns only update at refresh, so don't respond to slicer changes. Why isn't just using the columns from your original table in the matrix with slicers working? 

     

    Pat

    • timhopson's avatar
      timhopson
      Helper I

      Hi Pat, 

      I want the matrix data to appear as multiple rows, with a single column of figures.

       

      If I drag the columns from my original table, they will become mulitple columns with a single row (if filtered)

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi timhopson ,

     

    Please try create three measures and put them in matrix's values:

    then turn on the swith values to rows:

    Please check the simple pbix file. It also contains another method.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

    • timhopson's avatar
      timhopson
      Helper I

      Gao, 

      Thank you so much, that's really helped me out.

      regards, Tim.