Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Amitg_4890
New Member

Help me translate this MDX into DAX for creating a measure in power BI.

  1. Hey there, please help me translate this MDX into DAX for creating a measure in power BI. I am new in Power BI and I was assigned to translate this MDX script to create measure in power BI. The MDX is as follows;

 

CREATE MEMBER CURRENTCUBE.[Measures].[EmT]
AS IIF(([Units Of Measure].[UoM Code].&[0/EmT],[Measures].[Employee Time])=0.0,NULL,([Units Of Measure].[UoM Code].&[0/Emt],[Measures].[Employee Time])/([Units Of Measure].[UoM Code].&[0/EmT],[Measures].[Employee Time Count])/365.25),
FORMAT_STRING = "#,##0.0",
VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Employees';

 

I have "unitsofmeasures" table and "UoM code" field inside it already. It's just that MDX I can't seem to translate.

2 REPLIES 2
adudani
Super User
Super User

HI @Amitg_4890 ,

to my understanding: there are 2 measures in the cube called " Employee Time" and "Employee Count Time"

essentially

format(

if (

[Employee Time]= 0, blank() --null,

[Employee Time]/ [Employee Time Count] / 364.25
),

int
)

 

the above is then dax translation.

 

If you provide more information on the measures, we could create variables to add on the code and get the output.

 

Appreciate a thumbs up if this helps.

 

let me know if this resolves the question.

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

omg thank you very much for the response! 

And there's only employee time, nothing like employee count time but count is an aggregation which was used, I believe. Something like count(employee time). 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors