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
diegomartinop
Frequent Visitor

Convert DAX expression into a table

Hi all

 

I need to convert this DAX measure 

 

Measure =
CALCULATE(
   MAX('Table 1'[Status]),
   FILTER('Table 1','Table 1'[Level]=MAX('Table 1'[Level]))
)
 
into a new table. I tried with CALCULATETABLE and MAXX but it does not work.
I want to convert because the Sankey diagram I need to use does not accept measures in the axis
 
The data I have is as follows:
Table 1:
NameLevelStatus

Extract 2D plans

APSHigh
Extract 2D plansEXEMedium
Extract 2D plansLIVLow

Other Function

APSMedium
Other FunctionEXELow
Other FunctionLIVHigh

 

And what I want is as follows:

NameAPSEXELIV
Extract 2D plansHighMediumLow
Other FunctionMediumLowHigh

 

Thanks in advance.
2 REPLIES 2
Jihwan_Kim
Super User
Super User

Link to the pbix file 

 

I suggest pivoting the table in Power Query.

However, the link the pbix file (above) shows two solutions. (Power Query way and DAX).

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


@Jihwan_Kim thanks for your answer.

Actually I need something generic considering the distinct Levels. For example, if I have only APS and EXE, then I don't need the LIV column. However, if I have 4 distincts Levels, then I'll need 4 columns to be added. Would it be possible to generalize in DAX? In Power query I can't use because I have many calculated columns in DAX that are not available in Power query.

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