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

Line and Column chart - won't work with the measures I have (but data looks good in table view)

I'm working on some Formula1 data and want to show a drivers fastest lap at various circuits, and the lap record at those circuits side by side as a comparison. 

 

The data looks like this in table view: Table.png

 The page receives a Driver filter from another page drillthrough command, there's also a user filter on year (season) so multiple years can be selected. 

 

DriverFastestLap = CALCULATE(MIN(F1_LapTimes[time]))

 

CircuitLapRecord = CALCULATE(MIN(F1_LapTimes[time]),FILTER(F1_LapTimes,F1_LapTimes[CircuitID]=EARLIER(F1_LapTimes[CircuitID])))

 

I'm trying to display this in a stacked column chart, or a line and column but when I add the CircuitLapRecord to the Values box it automaticaly changes to 'Count of...'. I can't add the DriverFastestLap to the values box at all. 

 

Apologies, I'm fairly new at PowerBI and this one has me stumped!

 

Thanks, 

 

Nick. 

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

Hi @Anonymous ,

 

You could use split to configure your time value.

1-1.PNG

Then you could use splitted column 1 *60+splitted column 2 to get final time.

1-2.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could use split to configure your time value.

1-1.PNG

Then you could use splitted column 1 *60+splitted column 2 to get final time.

1-2.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
HotChilli
Super User
Super User

What is the datatype of the CircuitLapRecord?

Anonymous
Not applicable

Ah - it's a Text data type, which I guess is my problem. 

However, if I try to convert it to time, I get the following error: 

datatype.png

 

error.png

 

 

The powerbi engine doesn't like the conversion to a time (not a timespan - it's trying to convert to 1:22am with .683 secs)

The power query engine is more flexible but I don't think it's going to give you what you want which is a duration in h,m,s (which can be used in powerbi front end, manipulated mathematically and displayed correctly). Power Query has a duration type but power bi doesn't.

I see that you have a Duration column which is a decimal and this is probably your best option to use for the axis.  You could put the text circuitlaprecord column in the tooltips section of the chart so it's still available.

 

 

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.