The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
I am migrating application from qliksense to power Bi where i have 1 complex expresssion which i want to do in power BI.
Solved! Go to Solution.
In Power BI, you can achieve similar complex calculations and aggregations as in QlikSense using DAX (Data Analysis Expressions). However, translating complex expressions from one platform to another can be challenging, and it may require breaking down the logic into smaller steps to ensure accuracy.
The expression you provided in QlikSense appears to involve aggregation, distinct count, filtering, and nested conditions. I'll attempt to break down the expression step by step in Power BI DAX, but keep in mind that the exact translation may require some adjustment based on your specific data model and requirements.
Here's a breakdown of the expression in Power BI DAX:
Complex Measure =
VAR FilteredData =
FILTER(
'YourTable',
'YourTable'[Fact_Flag] = "App Object" &&
'YourTable'[_objectType] = "invoice" &&
'YourTable'[Status] IN {"ready", "rejected"} &&
'YourTable'[%_invoice_id] IN
CALCULATETABLE(
'YourTable',
FILTER(
'YourTable',
'YourTable'[Status] IN {"exported", "closed"}
)
)
)
VAR GroupedData =
SUMMARIZE(
FilteredData,
'YourTable'[Year],
'YourTable'[MonthYear],
'YourTable'[%_invoice_id],
"MaxModifiedTimestamp",
CALCULATE(
MAX('YourTable'[_modifiedTimestamp]),
FILTER(
FilteredData,
'YourTable'[%_invoice_id] = EARLIER('YourTable'[%_invoice_id])
)
)
)
VAR FirstInvoiceID =
SUMMARIZE(
GroupedData,
'YourTable'[Year],
'YourTable'[MonthYear],
'YourTable'[%_invoice_id],
"MaxModifiedTimestamp",
CALCULATE(
MAX('YourTable'[_modifiedTimestamp]),
FILTER(
FilteredData,
'YourTable'[%_invoice_id] = EARLIER('YourTable'[%_invoice_id])
)
)
)
VAR Result =
COUNTROWS(FirstInvoiceID)
RETURN
Result
Please note the following:
This Power BI DAX expression attempts to replicate the logic you provided in QlikSense, but it may require further refinement based on your specific data structure and requirements. Testing and validating the results with your data will be essential.
In Power BI, you can achieve similar complex calculations and aggregations as in QlikSense using DAX (Data Analysis Expressions). However, translating complex expressions from one platform to another can be challenging, and it may require breaking down the logic into smaller steps to ensure accuracy.
The expression you provided in QlikSense appears to involve aggregation, distinct count, filtering, and nested conditions. I'll attempt to break down the expression step by step in Power BI DAX, but keep in mind that the exact translation may require some adjustment based on your specific data model and requirements.
Here's a breakdown of the expression in Power BI DAX:
Complex Measure =
VAR FilteredData =
FILTER(
'YourTable',
'YourTable'[Fact_Flag] = "App Object" &&
'YourTable'[_objectType] = "invoice" &&
'YourTable'[Status] IN {"ready", "rejected"} &&
'YourTable'[%_invoice_id] IN
CALCULATETABLE(
'YourTable',
FILTER(
'YourTable',
'YourTable'[Status] IN {"exported", "closed"}
)
)
)
VAR GroupedData =
SUMMARIZE(
FilteredData,
'YourTable'[Year],
'YourTable'[MonthYear],
'YourTable'[%_invoice_id],
"MaxModifiedTimestamp",
CALCULATE(
MAX('YourTable'[_modifiedTimestamp]),
FILTER(
FilteredData,
'YourTable'[%_invoice_id] = EARLIER('YourTable'[%_invoice_id])
)
)
)
VAR FirstInvoiceID =
SUMMARIZE(
GroupedData,
'YourTable'[Year],
'YourTable'[MonthYear],
'YourTable'[%_invoice_id],
"MaxModifiedTimestamp",
CALCULATE(
MAX('YourTable'[_modifiedTimestamp]),
FILTER(
FilteredData,
'YourTable'[%_invoice_id] = EARLIER('YourTable'[%_invoice_id])
)
)
)
VAR Result =
COUNTROWS(FirstInvoiceID)
RETURN
Result
Please note the following:
This Power BI DAX expression attempts to replicate the logic you provided in QlikSense, but it may require further refinement based on your specific data structure and requirements. Testing and validating the results with your data will be essential.
Thanks for your valuable input, I tried this but i am getting below error it seems like something to do with IN operator.
User | Count |
---|---|
81 | |
74 | |
42 | |
30 | |
28 |
User | Count |
---|---|
108 | |
96 | |
53 | |
48 | |
47 |