ISLEAF and IIF MDX to DAX - mdx

I am currently working on migration of SSAS cube from Multidimensional to Tabular. I have many MDX queries.
For example:
IIF(IsLeaf([Currency].[Currency]),[Measures].[_Discount],null)
I was trying to understand, the above query with some data examples but no luck.
What is the above query mean in MDX?
How could I possibly write this in DAX?
Any help is really appreciated.
Thanks in advance.

Assuming your Currency hierarchy is just one level try:
IF(ISFILTERED(‘Currency’[Currency],[_Discount])

Related

Is there a way to convert this MDX syntax to DAX?

I'm changing a legacy multidimensional analysis services to tabular and "Converting" the MDX measures to DAX. (I don't have much knowledge using MDX)
I found the script below and i'm not sure what it is doing.
([Origin].[Origin].&[BUDGET FILE],[Measures].[Value])
I think it's is using the Column Value inside the Budget file located in the Origin to fill or create something in the measures.
So, first can anyone help me understand what this code is doing?
And second, would DAX support such thing?
Thanks!
Here is the equivalent assuming the Value measure is a Sum.
CALCULATE(SUM(YourTableName[Value]), 'Origin'[Origin]="BUDGET FILE")

Conditional Column POLL: SQL vs Power Query vs DAX

Need to add a multi conditional (approx 12) column to an Excel file and was wondering what was more efficient: SQL (CASE), M/PowerQuery (if-then-else), or DAX (SWITCH).
What are you experiences?
TIA,
Danny
I would use the Conditional Column feature in the Query Editor ("M/PowerQuery") for this requirement. It's the only option where you won't need to write any code at all, even for requirements like "does not contain" that are quite complex to code in your alternatives.
I tell my data analyst clients not to bother learning SQL any more - the Power BI Query Editor / Power Query for Excel is so much more productive.

How to obtain a list of all cube's translations?

I want to get a list of meta-data translations for our cube (measure groups + dimensions).
I've tried a MDX query in Management Studio:
SELECT *
FROM $system.MDSchema_hierarchies
WHERE [CUBE_NAME] ='DWH OLAP'
But can't see there any translation column. Any help would be appreciated. Thanks in advance.
Unfortunately, there is no Translation information at SSAS Management Views. You have to use Microsoft AMO for that, writing a program on .NET. Please find a code sample doing almost your task, and Microsoft Documentation on AMO.

MDX IN Or SubQuery

I am making a sales cube for a bank, I need to do a query with this Dimensions DimTiempo, DimCliente, DimCuenta
I need to find the number of customers who are in DimCuenta attribute [DimCuenta].[Planes].[Cue Nombre Plan] with value 'APORTES SOCIALES' And besides having another record in the DimCuenta with the attribute [DimCuenta].[Cue Codigo Aplicacion] with value 'L' also need to include in the result hierarchy [Ano Mes] of DimTiempo, I don't know to do this because I Don't know how to do an In or a subquery in MDX,
The best advise would be to take some time and read about MDX technology. There are a few principles that are different and need to be known.
I'd advise reading some introductions in MDX as this one. If you're more a reader there are some books on MDX. Sorry, long time I haven't read one can't advise.

Why does this kind of MDX Query always changed?

I'm currently dealing with FoodMart DB in Mondrian.
Whenever I'm executing query which has this element:
...[Time].[Quarter].[Q1]...
...[Time].[Quarter].[Q2]...
...
After parsing the query, Mondrian always changes that query into this form:
...[Time].[1997].[Q1]...
...[Time].[1997].[Q2]...
...
Generally, both forms yield the same result. The problem is I have to keep the level from that query ([Quarter]) in order to achieve all its member later. What I mean is that I need to execute this kind of query:
...[Time].[Quarter].Members...
which apparently its result can not be achieved from this form:
...[Time].[1997].Members...
Does anyone know how to set Mondrian to keep my original query form? Or are there any way to get the level name ([Quarter]) from the given level ([1997]) ?
Thanks a lot!