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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Chanise89
Helper I
Helper I

Enable Select All for Slicers Bound To Dynamic M Parameters In Power BI

Forgive me if this is answered already but I can't seem to find a solution...

 

My Subject title is basically what I am trying to accomplish. 

I need to enable the "__SelectAll__" function in my Slicer but I can't seem to update my code correctly. 

Can someone please help me with that! 

 

VDataCenter = 
   if 
    //check to see if the parameter is a list
      Type.Is(
        Value.Type(PCostCenter), 
        List.Type
      ) then 
        //if it is a list
        let
          //add single quotes around each value in the list
          AddSingleQuotes = List.Transform(
               PCostCenter, 
              each "'" & _ & "'"
            ),
          //then turn it into a comma-delimited list
          DelimitedList = Text.Combine(
              AddSingleQuotes, 
              ","
            )
        in
          DelimitedList
    else 
      //if the parameter isn't a list
      //just add single quotes around the parameter value
     "'"&PCostCenter&"'",
      
 
Source = Oracle.Database("RPTU", [HierarchicalNavigation=true, Query="select n_year,sum(total) total_amount,
       sum(comp_amount) compensation_amount,
       sum(op_exp_amount) operating_expense_amount,
       sum(var_exp_amount) variable_expense_amount
from (
select n_year, sum(actual_amount) as total,
      case when acc_level_1 = 'E7275' then sum(actual_amount) else 0 end comp_amount,
      case when acc_level_1 = 'E7420' then sum(actual_amount) else 0 end op_exp_amount,
      case when acc_level_1 = 'E7698' then sum(actual_amount) else 0 end var_exp_amount
from fcstexpense.TBL_GLVAR_QTR
where acc_level_0 = 'E7265'
and acc_level_1 in ('E7275','E7420','E7698')
and n_year= '"&PYEAR&"'
and vch_quarter in("&Quarters&")
and center_member IN (SELECT DISTINCT  vchmembername
                        FROM XXPRUWH.tblHierpointAncestry
                       WHERE vchHierarchy='Current_C:Total Center - Balanced'
                          AND vchsumtomembername in ("&Vsummary&")
                          AND chmemberpointtype = 'D')
and center_member in ("&VDataCenter&") 
  and productgroup_member IN (select distinct B.vchMemberName vchMemberName
                              from xxpruwh.tblHierSumNav A, xxpruwh.tblHierDataNav B
                              where A.vchHierarchy = B.vchHierarchy
                                and A.vchSumToMemberName='G0001' --- Product Filter
                                and A.vchMemberName = B.vchSumToMemberName
                                and A.vchHierarchy = 'Current_P:Product Group')
  and entity_member IN (select distinct B.vchMemberName vchMemberName
                        from xxpruwh.tblHierSumNav A, xxpruwh.tblHierDataNav B
                        where A.vchHierarchy = B.vchHierarchy
                          and A.vchSumToMemberName='P0000' --- Entity Filter
                          and A.vchMemberName = B.vchSumToMemberName
                          and A.vchHierarchy = 'Current_E:Profit Center')
  group by n_year,acc_level_1)
group by n_year"])
in
  
 Source

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @Chanise89,

I think the ‘select all’ option should configured on the data view side instead of added it in your query parameters:

Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @Chanise89,

I think the ‘select all’ option should configured on the data view side instead of added it in your query parameters:

Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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