Forum Discussion
shavish
1 year agoHelper I
SQL query- Power query BI help
I have following query with 5 parameters. When i select all 5 parameters, i see the entry is shown in Power BI desktop. If any of the selection is missing, the values aren't shown. My requirement...
- 1 year ago
SELECT DISTINCT Name, Desc as Description, Category, Usage, No_of_Pages, Author, Confidential FROM Docsdb.dbo.tblProperty WHERE (CASE WHEN '" & Confidential_Flag &"'='1' AND Confidential='1' THEN 1 WHEN '" & Confidential_Flag &"='0' AND Confidential='0' THEN 0 ) AND ('" & Doc_Name &"' = '' OR Name = '" &Doc_Name &"') AND ('" & Doc_Desc &"' = '' OR Desc = '" &Doc_Desc &"') AND ('" & Category &"' = '' OR Category = '" &Category&"') AND ('" & Usage &"' = '' OR Usage = '" &Usage&"')You were wrapping the catergories in '' so blanks would of always been empty strings. Try the above
V-yubandi-msft
1 year agoCommunity Support
Hi shavish ,
Thank you for the update. It's encouraging to know your query works in SQL. However, Power BI may handle parameter filtering differently. The solution provided by johnbasha33 , ensures that when parameters are not selected, all records are displayed rather than filtered out. Please try this fix in Power BI and inform us if you encounter any issues.
Thank you for your responses johnbasha33 & Deku .
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.