Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi All,
I am connecting to a Postgres Database using Direct Query.
When ever I try to do a visual on a calculated field or measure I get the following error:
We couldn't fold the expression to the data source. Please try a simpler expression.
I can do it on a non calculated field but not on calculated.
My measure has the following code in it.
(This converts seconds to show 00 hours 00 minutes 00 seconds)
TotalTalk Time = var total = sum(mb_callstats[call_servicing_sec]) var hours = int(total/3600) var minutes = int(mod(total, 3600)/60) var seconds = mod(mod(total, 3600),60) return hours & " hours " & minutes & " minutes " & seconds & " seconds"
Which pulls from a calculated column with the following code in it:
(This converts time format 00:00:00 to seconds)
call_servicing_sec = SECOND(mb_callstats[call_servicing]) + MINUTE(mb_callstats[call_servicing]) * 60 + HOUR(mb_callstats[call_servicing]) * 3600
Similar issue has been reported: CRI 189036561.
if you could try while transforming data- https://community.powerbi.com/t5/Desktop/Calculate-difference-between-two-dates-power-query/m-p/6236...
like using each Duration.Days([Date1] - [Date2])
Regards,
Lin
@MrDannyHarry , refer the problem test given in -https://community.powerbi.com/t5/Desktop/Postgres-EnableFolding/m-p/839734
If setting can help
Thanks for your prompt reply.
My current query is a s follows:
let
Source = PostgreSQL.Database("IP_ADDRESS", "DB_NAME", [CreateNavigationProperties=false]),
public_mb_callstats = Source{[Schema="public",Item="mb_callstats"]}[Data]
in
public_mb_callstats
What would need to change?