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
taylorrc
Regular Visitor

Use Measure as Axis in visual

I am trying to create a visual similar to this:

 

2-28-2017 2-48-38 PM.png

but I need to include some values that are sumations of some of the columns. For example, a total column that is a sum of all the values. Another is a value called "Accpeted" that is a sum of Imlplemented, Assigned to Team, Ready for Implementation, and Being Piloted. 

I've created measures to generate all these numbers for me, but I cannot get the visualization to allow me to use the measure name for the axis label. Is there a way to do that, maybe through a calulated table? I'm new to Power BI and visual analytics in general. Thanks in advance for any help. 

 

1 ACCEPTED SOLUTION

I solved the issue. I created a new table with the axis lables in the first column, then used If statements to look at the value in the first column. If it was one of the subtotals, it returned the measure I created. If it was an actual status, I used:

CALCULATE(counta('Idea Factory One Utility'[Status Of Idea]),
FILTER(all('Idea Factory One Utility'), 'Idea Factory One Utility'[Status Of Idea]=Idea_Status[Status Type]))

View solution in original post

6 REPLIES 6
samdthompson
Memorable Member
Memorable Member

Hi, I assume that you have a whole table of data that has all the projects on it with some sort of mixture of flags that in an order give you whatever the status is. What you will want to do is make a calculated column  (on the modelling tab) and make a column that has all the logic in it to create each of teh the statuses you want on your axis. This is just an IF() statement or if you want a SWTICH(). SO you will have something like:

 

Status = IF(OR(Table[status] = "accepted",Table[status] = "just about accepted"),"Accepted" ...etc.... )))

 

 

Satus = SWITCH(Table[status], "accepted","Accepted","just about accepted","Accepted" ....etc... )))

 

You then use the status column as the x axis. You should need any other measures that a count of projects..

 

 

 

// If this is an answer to your question please mark as such

// if this is a solution please mark as such. Kudos always appreciated.

Hi - I also am unclear how to use the if or swtich statements particularly if we are creating the new 'dummy' table to just hold the axis lables and it does not have any relationship with the fact or table that holds the measures. 

 

I have to categories that I want on the axis Direct and Sub and I have 4 measures total where 2 need to show in the Sub category and 2 others need to show in the Direct category. i've just one measure calculation for each category below.

 

To show in Direct category:

Direct Budget = CALCULATE (
sum( 'Fact Budget'[BudgetAmount] ), 'dim Account'[SummaryCategory (groups)]="Direct Categories", 'Fact Budget'[BudgetDescription]="Reforecast")

 

To show in Sub category:

Sub Budgets = 
CALCULATE (
sum( 'Fact Budget'[BudgetAmount] ), 'dim Account'[SummaryCategory]="Subawards")
 

The attempted SWITCH statement, I could not get SWITCH to accept just the dummy 'axis' column I created as the first argument

DirectSub = SWITCH(SELECTEDVALUE('Finance Axis'[Axis]),"Direct", [Direct Budget] || [Direct Actuals], "Sub", [Sub Budgets] || [Sub Totals])
 
I added the 'axis' column as the chart axis but measures are still showing in each category. forum1.PNG

That gets me part of the way there. I need to also include a "subtotal" as a vlaue on the axis. Here is the original graph that I'm trying to recreate

3-1-2017 8-17-13 AM.png

The grey bars are sub totals of the actual statuses. It was created in excel using three series. The Grey bar is one, the orange is another, and the "clear" bar is the third. In the series for the grey bars, the value for the orange and clear is zero, making it appear they are not there.  This can be acomplished because I can manually indicate the values for the axis and then assign data to the three series. 

 

I've got all the values I need, I created them using measures, but I can't figure out how to get that measure to align with an axis label. Is there a way to create a new table with the axis labels in a column, and then refernce the measures in the next column?

 

Any help is appreciated. 

I solved the issue. I created a new table with the axis lables in the first column, then used If statements to look at the value in the first column. If it was one of the subtotals, it returned the measure I created. If it was an actual status, I used:

 

CALCULATE(counta('Idea Factory One Utility'[Status Of Idea]),
FILTER(all('Idea Factory One Utility'),
'Idea Factory One Utility'[Status Of Idea]=Idea_Status[Status Type]))

 This retuned the values that I needed for the visualtion. Its a little brute force, but it worked. 

Hi taylorrc, it seems a great solution !

 

But I don't understand how you inplement your "IF statements" to look at your table with x labels

and return the correct measure : subtotal or the value.

 

Could show me the differents steps you implemented ?

 

Thank you and have a nice day !

Fred

I solved the issue. I created a new table with the axis lables in the first column, then used If statements to look at the value in the first column. If it was one of the subtotals, it returned the measure I created. If it was an actual status, I used:

CALCULATE(counta('Idea Factory One Utility'[Status Of Idea]),
FILTER(all('Idea Factory One Utility'), 'Idea Factory One Utility'[Status Of Idea]=Idea_Status[Status Type]))

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.