Forum Discussion
DCELL
6 years agoResolver I
Apply query changes getting stuck (small dataset)
I have a small dataset (1115 rows, 5 columns) imported from SSMS. All my query changes have been fine so far, but when I try to add a simply conditional column and try to apply, it will get stuck he...
- 6 years ago
Well guys - yesterday it didn't work and today it did. I still don't know why, maybe the old pc needed a reboot. Thanks for your replies anyhow.
If someone runs into the same problem in the future I guess they could try a reboot first and then see if it works 😃
DCELL
6 years agoResolver I
Yes, SQL Server.
I'm trying to add it in Power Query, I don't know of a way to add it in DAX.
I didn't specify an SQL query in the advanced options when I imported. I can view the native query and see the full query fold and the lines of data where it put in the conditional column with a CASE statement:
select [_].[Yr] as [Yr],
[_].[MonthNo] as [MonthNo],
[_].[amt] as [amt],
[_].[gltr_domain] as [domain],
[_].[MonthEnd] as [Date],
[_].[Currency] as [Currency]
from
(
select [_].[Yr] as [Yr],
[_].[MonthNo] as [MonthNo],
[_].[amt] as [amt],
[_].[gltr_domain] as [gltr_domain],
[_].[MonthEnd] as [MonthEnd],
case
when [_].[gltr_domain] = 'usa'
then 'USD'
else 'Other'
end as [Currency]
from
(
select [_].[Yr],
[_].[MonthNo],
[_].[amt],
[_].[gltr_domain],
[_].[MonthEnd]
from [DATABASE].[TABLE] as [_]
) as [_]
) as [_]
order by [MonthEnd],
[gltr_domain]
lbendlin
6 years agoSuper User
run that same query in SSMS and check its performance.