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

Use of measures restricted in visuals

I'm trying to use a custom Gantt chart visual (xViz) that requires a start and end date.  My data, however, only has end date and duration.  So I created a measure to calculate start date: 

StartDate = SELECTEDVALUE(Sheet1[End Date]) -
TIME(0,0,SELECTEDVALUE(Sheet1[Duration]))
The issue is the Gantt chart visual will not let me select a measure for the Start Date.  I've run into this before and don't understand why a visual would have this restriction.
5 REPLIES 5
AlexisOlson
Super User
Super User

In general, you cannot use a measure as one of the dimensions on a visual, whether xViz or one of the default visuals.

 

However, you can use a calculated column. Try defining this as a calculated column and use that instead.

StartDate = Sheet1[End Date] - TIME ( 0, 0, Sheet1[Duration] )

 

I need the start date to be a measure to take into account the context of the evaluation... the field "Duration" itself is a measure.  Here's an example why.  I'm evaluating intervals, for example, vehicle maintenance intervals.  I want to be able to initially evaluate the intervals between general maintenance activities by vehicle, then evaluate intervals for sub-classes of general maintenance, say oil changes.   Let me add that the xViz Gantt chart visual does an excellent job of this when it's fed "proof of concept" data by way of a spreadsheet!

I see. That does explain why my suggestion doesn't work but doesn't change the fact that measures are not columns you can use as dimensions in a visual.

 

I don't think I can come up with a different workaround without having a sample file to tinker with.

OK, let me try to understand something even more basic... but let me first state that I'm using a live connection, so I can't create any calculated columns.  So my report user has an existing bar chart report whose axis is month.  But now they want the same report with an axis of week.  Week doesn't currently exist in the data model, but I can simply create a measure that uses the DAX weeknum command.  But wait, the bar chart visual will not let me assign a measure to the axis.  I just don't understand; that seems like such a basic requirement!

That's correct. In order to use a dimension, it has to be part of the data model.

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