Forum Discussion
Facing LOD issues while trying to convert the Tableau calculated fields into PowerBI DAX
We are facing LOD issues,
the dax which we are creating is also LOD which in turn is calling LOD itself in the Dax.
Tableau Calculated Field:
NValue=IF [Invoiced Flag] = TRUE and [GR Value Flag] = TRUE
THEN
{FIXED [PO Line - Ref Doc]: SUM([IR-SD Value (LOD) (USD)]) }
ELSEIF
[Invoiced Flag] = FALSE and [GR Value Flag] = TRUE
THEN
{FIXED [PO Line - Ref Doc]: SUM([GR Value (USD)]) }
ELSE 0
END
PowerBI DAX which we tired :
NValue =
VAR InvoicedFlagCount =
COUNTROWS(FILTER(Append1, Append1[Invoiced Flag Sample] = TRUE()))
VAR GRValueFlagCount =
COUNTROWS(FILTER(Append1, Append1[GR Value Flag sample] = TRUE()))
RETURN
SWITCH(
TRUE(),
InvoicedFlagCount > 0 && GRValueFlagCount > 0, [Nominal Value IR M],
InvoicedFlagCount = 0 && GRValueFlagCount > 0, [Nominal Value GR M],
0
)
Tableau result : 7,598,481,586
PowerBI Result: either 0 or huge value
Based on this DAX we have to create another 2 LOD :
Kindly help to find a solution for this issue.
2 Replies
- lbendlin
Super User
There is no solution. Power BI does not support LOD. You need to bring your own static buckets.
- AnonymousNot applicable
Hi JVK
Please try the following Dax:NValue = VAR InvoicedFlag = SELECTEDVALUE(Append1[Invoiced Flag Sample]) VAR GRValueFlag = SELECTEDVALUE(Append1[GR Value Flag sample]) RETURN SWITCH( TRUE(), InvoicedFlag = TRUE() && GRValueFlag = TRUE(), CALCULATE(SUM(Append1[IR-SD Value (LOD) (USD)]), ALLEXCEPT(Append1, Append1[PO Line - Ref Doc])), InvoicedFlag = FALSE() && GRValueFlag = TRUE(), CALCULATE(SUM(Append1[GR Value (USD)]), ALLEXCEPT(Append1, Append1[PO Line - Ref Doc])), 0 )-
Variable Definitions:
- InvoicedFlag : Retrieves the value of [Invoiced Flag] Sample in the current context.
- GRValueFlag : Retrieves the value of [GR Value Flag] sample in the current context.
-
SWITCH Statement: Returns different calculation results based on conditions.
- If both InvoicedFlag and GRValueFlag are TRUE, it calculates the sum of [IR-SD Value (LOD) (USD)] at the [PO Line - Ref Doc] level.
- If InvoicedFlag is FALSE and GRValueFlag is TRUE, it calculates the sum [GR Value (USD)] of at the [PO Line - Ref Doc] level.
- If none of these conditions are met, it returns 0.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
-