Forum Discussion
Converting DAX to MDX
I did not had time to check them all yet.
But 'Days Shorted' is just a name of DAX measure sorry for including it I undrestand why it could have caused missunderstanding.
Only this part is the actual DAX code:
VAR _Table =
Hi Justas4478 ,
Are you saying here:
Here I created a Calculated member called [Measures].[DaysShorted] to count the number of non-zero Shorted Qty entries.
If this doesn't work, you can try this one:
WITH
MEMBER [Measures].[ShortedQty] AS
[Measures].[Shorted Qty]
SET [ShortedTable] AS
NONEMPTY(
[Product Category].[Level 2].MEMBERS *
[Date].[Date].MEMBERS,
[Measures].[ShortedQty]
)
MEMBER [Measures].[FilteredShortedQty] AS
SUM(
FILTER(
[ShortedTable],
[Measures].[ShortedQty] <> 0
),
[Measures].[ShortedQty]
)
MEMBER [Measures].[CountFilteredShortedQty] AS
COUNT(
FILTER(
[ShortedTable],
[Measures].[ShortedQty] <> 0
)
)
SELECT
[Measures].[CountFilteredShortedQty] ON COLUMNS,
NONEMPTY([Date].[Date].MEMBERS) ON ROWS
FROM [YourCubeName]
But to be honest, sometimes it is difficult to convert directly from DAX to MDX. If it is still incorrect, perhaps you need to provide your data and explain what you want to accomplish with DAX/MDX.
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.
- Justas44781 year agoPost Prodigy
The reason why I am trying to conver DAX to MDX.
I have power bi report with these measures.
But I cant do pivot tables in power bi reports.
And since my cube is live model, I as well cant do calculated columns.
So I connected cube to excel and hoped that I can recreate those measures and use them for report creation.