The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
The below DAX expression returns the expected results in DAX Studio ( a two column table) when connected to a Power BI data model in the Service. However, when I attempt to use the same logic (the expression is modified at the end to return a scalar value and EVALUATE is removed), I receive these contect error messages as well as this overall error message.
Is there something different between how DAX studio is evaluating this and how Power BI is evaluating it?
******
EVALUATE
(
VAR dates =
SUMMARIZECOLUMNS (
dimDate[EndOfMonth],
dimDateMaturity[AdjustedMaturityDate],
"@diff",
[a] + [b] - [c]
)
VAR filtered =
FILTER ( dates, [@diff] < 0 )
VAR indexed =
INDEX (
1,
filtered,
ORDERBY ( [@diff], DESC ),
PARTITIONBY ( dimDate[EndOfMonth] )
)
RETURN
SELECTCOLUMNS (
indexed,
"Date", dimDate[EndOfMonth],
"Days", DATEDIFF ( dimDate[EndOfMonth], dimDateMaturity[AdjustedMaturityDate], DAY )
)
)
Hi,
Please try something like below.
I only wrote for SUMMAIZECOLUMNS part to suggest to change like below.
VAR dates =
ADDCOLUMNS (
SUMMARIZE (
YourFactTable,
dimDate[EndOfMonth],
dimDateMaturity[AdjustedMaturityDate]
),
"@diff",
[a] + [b] - [c]
)
I tried that and the same issue persists. Again, it works in DAX studio but it doesn't work in Power BI. For some reason the indexed variable is not able to reference the filtered variable.
User | Count |
---|---|
24 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |