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.
Please bare with me as I try my best to explain what I am trying to accomplish.
We are in the process of building a new PBI dashboard using Parameters w/ Direct Query. So far everything is going smoothly (Maybe I shouldnt have said that out loud!) However, my sql develeoper has one ask that I am stumped on.
There is a character limit in the DB so she is wondering if there is a way to only pass the Code to the DB but display the Description in the Filters? I have successful created my parameters using the Codes but I can't figure out how to display the Description on the front end while only passing the Code to the DB. I hope this makes sense....
A picture is worth a thousand words...
As you can see in the 1st Screenshot, the right two tables are the code names... It works as expected
Here is the code that I am using...
let
Quarters =
if
//check to see if the parameter is a list
Type.Is(
Value.Type(PQuarter),
List.Type
) then
//if it is a list
let
//add single quotes around each value in the list
AddSingleQuotes = List.Transform(
PQuarter,
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
"'" & PQuarter & "'",
Vsummary =
if
//check to see if the parameter is a list
Type.Is(
Value.Type( PParentPoint),
List.Type
) then
//if it is a list
let
//add single quotes around each value in the list
AddSingleQuotes = List.Transform(
PParentPoint,
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
"'"& PParentPoint & "'",
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
"'"&Text.Middle(PCostCenter,0,6)&"'",
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
Hi @Chanise89,
If I understand correctly, the code field is obtained from the data source and the description field is not obtained because of the character length limitation. However, now you want to use this code field to display the description information on the slicer. If that is the case, I'm afraid it can't implement such a feature.
You can submit a new idea. It is a place for customers provide feedback about Microsoft Office products . What's more, if feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.
Best Regards
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |