Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ValentinB
Frequent Visitor

Calculating DAX Measure (% Deviation) using Name Slicer Value

Good day all,

 

I am trying to wrap my head around an issue and can't seem to figure it out. Also tried searching different topics and either it didn't work or I didn't understand something in full.

 

I have created the following Measure:

 

Fuel per Hour =
VAR Total_Trip_Time =
SUMX(
Flight_Indicators,
HOUR(Flight_Indicators[Actual Trip TIme]) + MINUTE(Flight_Indicators[Actual Trip TIme])/60 + SECOND(Flight_Indicators[Actual Trip TIme])/3600)

VAR Total_Trip_Time_INT =
TRUNC(Total_Trip_Time,2)

VAR Total_Trip_Fuel =
CALCULATE(
SUMX(Flight_Indicators,
Flight_Indicators[Block fuel at TOGA push KG] - Flight_Indicators[Block fuel at TD KG]),
FILTER(Flight_Indicators, Flight_Indicators[Block fuel at TOGA push KG] > 0))
RETURN
DIVIDE(Total_Trip_Fuel, Total_Trip_Time_INT)

 

In terms of "Slicers", I have a Name Slicer and a Date Slicer

 

Using the "Card" Visualization I have shown

1) First Card: Amount of fuel/hour based on individual selection from Name Slicer for given Date

2) Second Card: Amount of fuel / hour for given Date (basically "company" value, Name Slicer does not affect this card due to "Edit Interactions" feature)

 

The measure that I am trying to solve is to find the % Deviation of the individual vs company. I've tried using combinations of CALCULATE with SELECTEDVALUE or FILTER but don't seem to figure it out.

 

Any information and guide towards the right direction is very much appreciated and I will be happy to give more information if needed

 

I have also attached an image with the model of the pbix

 

Model.PNG

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ValentinB ,

 

I have built a simple data sample:

Eyelyn9_0-1640660451952.png

individual = SUM('Table'[Hour]) 
company = CALCULATE(SUM('Table'[Hour]),REMOVEFILTERS('Table'[Name]))
% Deviation = ( [individual]-[company]) / [company]

 

Output:

Eyelyn9_1-1640660521357.png

 

 

If you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @ValentinB ,

 

I have built a simple data sample:

Eyelyn9_0-1640660451952.png

individual = SUM('Table'[Hour]) 
company = CALCULATE(SUM('Table'[Hour]),REMOVEFILTERS('Table'[Name]))
% Deviation = ( [individual]-[company]) / [company]

 

Output:

Eyelyn9_1-1640660521357.png

 

 

If you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @Anonymous ,

 

Many thanks for your help, indeed it worked on my side as well. Was not fully aware of the "REMOVEFILTER" function but I am glad I've learned something new.

 

Best wishes and Happy Holidays !

amitchandak
Super User
Super User

@ValentinB , As you want selectedvalue as a benchmark, you need an independent table

 

So you need an independent company name table and use that in a measure to get that companies value and this should interact with visual

 

Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello @amitchandak ,

 

I have accepted as a solution @Anonymous method since it worked but I will also check and try to implement your part as I am on a learning curve regarding PowerBi and every intel is a good chance to develop more skills and methods.

 

Many thanks as well for your reply and wish you also Happy Holidays.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.