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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
GillyGils
Frequent Visitor

Converting MDX to DAX Measures

Hi All,

First time posting and hoping the community would be able to help me out or point me in the right direction with this. I'm converting a few Measures from a Multidimensional to a Tabular model. I'm getting a bit lost in this converison process of this particular measure.

 

Theres a custom table 'Seasons' with 2 values from the Multidimensonal model that has no joins to the 'Measures' Fact table but it is binding the measures of the fact table using MDX via Calculations in the Multidimensonal. The expression is:

Case

When

[Seasons Dimension].[Seasonality].CurrentMember IS [Seasons Dimension].[Seasonality].&[2.]

Then ROUND([Measures].[Seasons_Count_1]) Else [Measures].[Seasons_Count_2]

End

 

I was wondering if this type of MDX query can be converted to DAX?

 

Cheers

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @GillyGils ;

Try it.

measure =
IF (
    'Seasons'[Seasonality] = 2,
    ROUND ( [Seasons_Count_1], 0 ),
    [Seasons_Count_2]
)

If it is not correct, can you screenshot the simple data in your powerbi and the result you want to output?
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
GillyGils
Frequent Visitor

Thank you for your input guys. Got myself confused at looking at SelectedMeasures & Haseonvalues 😑 This is the final formula I used to get my desired results:

Measure_Test = IF(SELECTEDVALUE('Seasons'[Seasonaility]) = 2, ROUND(SUM([Season_Count_1),0),
[Seasons_Count_2]))

I will need to use the SWITCH function in over statements but this was a good base for me. Only really starting to getting the hang of DAX. Thanks for the help!

v-yalanwu-msft
Community Support
Community Support

Hi, @GillyGils ;

Try it.

measure =
IF (
    'Seasons'[Seasonality] = 2,
    ROUND ( [Seasons_Count_1], 0 ),
    [Seasons_Count_2]
)

If it is not correct, can you screenshot the simple data in your powerbi and the result you want to output?
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

the measures of the fact table

That's not really a thing in Power BI (Host table notwithstanding).  You can use a similar SWITCH statement to change the measure logic based on an input value.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors