Forum Discussion
Justas4478
1 year agoPost Prodigy
Converting DAX to MDX
Hi, I am trying to converte my DAX to MDX I can manage to converte simple ones but I am struggling with complex ones. There are the measure that I cant convert and the error messages I get. 1. ...
Anonymous
1 year agoNot applicable
Hi Justas4478 ,
Please try whether these MDXs can work:
WITH
MEMBER [Measures].[ShortedQty] AS
[Measures].[Shorted Qty]
MEMBER [Measures].[DaysShorted] AS
COUNT(
FILTER(
NONEMPTY(
[Product Category].[Level 2].MEMBERS
* [Date].[Date].MEMBERS,
[Measures].[ShortedQty]
),
[Measures].[ShortedQty] <> 0
)
)
SELECT
[Measures].[DaysShorted] ON COLUMNS,
NONEMPTY(
[Date].[Date].MEMBERS
) ON ROWS
FROM [YourCubeName]
WITH
MEMBER [Measures].[DaysShortedLabel] AS
CASE
WHEN ISEMPTY([Measures].[Days Shorted]) THEN "0 days Short"
WHEN [Measures].[Days Shorted] = 1 THEN "1 days Short"
WHEN [Measures].[Days Shorted] = 2 THEN "2 days Short"
WHEN [Measures].[Days Shorted] = 3 THEN "3 days Short"
WHEN [Measures].[Days Shorted] = 4 THEN "4 days Short"
ELSE "5 days Short or more"
END
SELECT
[Measures].[DaysShortedLabel] ON COLUMNS,
-- Add the appropriate rows or dimensions you need on ROWS here
FROM [YourCubeName]
WITH
MEMBER [Measures].[SKUCount] AS
COUNT(
NONEMPTY(
[Product].[SKU Number].[SKU Number].MEMBERS
)
)
SELECT
[Measures].[SKUCount] ON COLUMNS,
-- Add the appropriate rows or dimensions you need on ROWS here
FROM [YourCubeName]
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Justas4478
1 year agoPost Prodigy
I just tried 3rd MDX and got this error: