Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi everyone,
I'm hitting a Formula Firewall wall in a Power BI Service Dataflow and I need to resolve it without losing my complex transformation logic in the report_WA query.
The Setup:
The Error: "Privacy settings don't allow the combination of data from multiple sources in the same query."
What I've tried:
Thank you a lot : )
Thank you, i will sure watch : )
The only way I have successfully got something similar to work like this is to have everything running within a single table. Typically the formula file rule comes up when you're having two tables with 2 different data sources and when you have a lot of complexity as you're explaining here. It then is very difficult to navigate multiple tables. While it can get pretty complex. That is what I have done in the past to overcome this formula firewall rule.
Thank you,
the data source is only 1 as a postgress DB, but i'm afraid is evaluating the functions as external tables.
So as you suggest i will try to put the 2 following function inside each query that needs them (even if i don't like a so static structure)
(dateTimeUtc as nullable datetime) as nullable datetime =>
let
result =
if dateTimeUtc = null then
null
else
let
year = Date.Year(dateTimeUtc),
// Ultima domenica di marzo (inizio ora legale)
marchLastDay = #date(year, 3, 31),
marchWeekday = Date.DayOfWeek(marchLastDay, Day.Sunday),
dstStart = #datetime(year, 3, 31 - marchWeekday, 2, 0, 0),
// Ultima domenica di ottobre (fine ora legale)
octoberLastDay = #date(year, 10, 31),
octoberWeekday = Date.DayOfWeek(octoberLastDay, Day.Sunday),
dstEnd = #datetime(year, 10, 31 - octoberWeekday, 3, 0, 0),
// Controlla se la data è in ora legale
isDst = dateTimeUtc >= dstStart and dateTimeUtc < dstEnd,
// Offset orario
offsetHours = if isDst then 2 else 1,
// Aggiungi offset
converted = dateTimeUtc + #duration(0, offsetHours, 0, 0)
in
converted
in
DateTime.From(result)(tbl as table, translationTbl as table, columnsToTranslate as list) as table =>
let
// 1. Assicuriamoci che la tabella delle traduzioni sia in RAM
BufferedTranslations = Table.Buffer(translationTbl),
// 2. Creiamo il dizionario (chiave -> valore)
TranslationRecord = Record.FromList(
BufferedTranslations[Value],
BufferedTranslations[TranslationKey]
),
// 3. Prepariamo le istruzioni: se c'è un null, lascia null.
// Altrimenti cerca nel dizionario. Se non trova la traduzione, tiene il valore originale.
TransformOperations = List.Transform(
columnsToTranslate,
(colName) => {
colName,
each if _ = null then null else Record.FieldOrDefault(TranslationRecord, Text.From(_), _),
type text
}
),
// 4. Applichiamo tutte le traduzioni alla tabella in una sola passata
TranslatedTable = Table.TransformColumns(
tbl,
TransformOperations,
null,
MissingField.Ignore
)
in
TranslatedTablelet's see if is enough to solve the problem : )
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.