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

measure for fuel consumption, two sources amount of liters, amount of kilometers

I have to make a measure for fuel consumption, two sources amount of liters, amount of kilometers for each car; result: one column with two types of readings | l/km | km/l | my issue come with when filtered on slicer ( type of car) … I done with two different column | l/km | km/l |

Thanks

7 REPLIES 7
amitchandak
Super User
Super User

@carlosam , Can you share sample data and sample output in table format?

Please your comments:

_kpi_Rendimientos RO_TR v04 =
VAR _Litros = SUM ( Integral_Mensual_Rend_Costo_stg[Combustible (lts)])
VAR _Recorridos = SUM (Integral_Mensual_Rend_Costo_stg[Total Horas/KM por periodo])
VAR _slicer = IF ( SELECTEDVALUE( Nombre_Comun_tbl[Unit]) = "k", 1, 0)
VAR _kmh = DIVIDE( _Recorridos, _Litros)
VAR _lth = DIVIDE( _Litros, _Recorridos)
RETURN
IF ( _slicer = 1, _kmh, _lth)

Hi @carlosam ,

 

Is your issue solved now?If not,could you pls check my last reply?

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

Hi  @carlosam ,

 

I have checked your request,your expression seems no problem,what is your expected output?

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

My friend, with this info can you suggest solution.

DateKmliterCar
1-Aug3540A
1-Aug 20B
3-Aug404B
3-Aug 10A
4-Aug395B
5-Aug5255A

Good mornig, thank you sr

carlosam_0-1629394132497.png

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.