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
Anonymous
Not applicable

Unpivot Measures (for categorical chart)

Hi guys.

 

I've seen one or two posts with an issue close to this one and there was no solution, but I really think (and hope) that there must be a way around this.

 

Sooo, I created a few Measures and I would like to create a Radar Chart (custom visual) with them. The problem is that the visual requires categorical data.

 

Untitled.png

 

 

 

 

 

 

 

 

 

 

 

If it was the query editor I would unpivot the data.

 

Is it possible to create a temporary table in DAX and emulate the "UNPIVOT" procedure?

 

Thanks in advance.

 

Cheers.

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

How about a new calculated table from Modelling Tab

Table =
VAR T1 =
    SUMMARIZE ( Table1, [ID], "Measure", 1, "Value", [Measure1] )
VAR T2 =
    SUMMARIZE ( Table1, [ID], "Measure", 2, "Value", [Measure2] )
VAR T3 =
    SUMMARIZE ( Table1, [ID], "Measure", 3, "Value", [Measure3] )
RETURN
    UNION ( T1, T2, T3 )

Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

How about a new calculated table from Modelling Tab

Table =
VAR T1 =
    SUMMARIZE ( Table1, [ID], "Measure", 1, "Value", [Measure1] )
VAR T2 =
    SUMMARIZE ( Table1, [ID], "Measure", 2, "Value", [Measure2] )
VAR T3 =
    SUMMARIZE ( Table1, [ID], "Measure", 3, "Value", [Measure3] )
RETURN
    UNION ( T1, T2, T3 )

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Hey, thanks a lot for your response.

 

It makes a lot of sense.

 

But I step on a problem I had before with the SUMMARIZE function. As the measures I use are refering other tables (DIM Tables) with filters, the values I get on those columns out of the SUMMARIZE function are all the same. I created an extra MonthYear column to group by Month.

 

Untitled.png

 

 

 

 

 

 

For example, the measure I used for this one is like:

 

RANK =
DIVIDE (
    [UNITS] - AVERAGEX ( ALL ( 'DIMTABLE' ); [UNITS] );
    AVERAGEX ( ALL ( 'DIMTABLE' ); [UNITS] )
)

 

Any idea why this is happening?

 

Thanks again.

@Anonymous

 

Its difficult to understand whats going on

 

May be if you could share the file with expected output...hopefully someone would be able to find a solution

 

But I feel that we could summarize the Tables just the way they are summarized in the VISUAL using SUMMARIZE function

 

Then use "SELECTCOLUMNS" to get relevant columns

 

and then do a union of these tables


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

I guess I'll have to wait for that. This problem has been bothering me for some time.

 

Thanks a lot, I marked your post as solution anyway because it could/should have solved my problem, the logic is correct.

 

Thanks!

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.