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
vijay273162
Helper III
Helper III

IF condition HELP

HI

In below table, I need to return 3rd row "GM" Company with "1" in [IF 80%] measure.

I write DAX as.... [IF 80 %] = IF([**bleep**. % of Total] <0.8,1,0)

 
Note : [**bleep**. % of Total] & [Rank] are measures -------- which needs to be used in [IF 80%] ---------- to get "1" in 3rd row.
 

vijay273162_0-1642023951006.png

 

1 ACCEPTED SOLUTION

Hi @vijay273162 ,

 

Try to create a measure like below:

IF 80% = 
VAR MIN_ = MINX(ALL('Table'),ABS('Table'[cum %of total]-0.8))
VAR VALUE_ = CALCULATE('Table'[cum %of total],FILTER(ALL('Table'),ABS('Table'[cum %of total]-0.8)=MIN_))
RETURN IF([cum %of total]<=VALUE_,1,0)

Vlianlmsft_0-1642486712443.png

 


Best Regards,
Liang
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
wdx223_Daniel
Super User
Super User

IF 80% = VAR _rx=[Rank] RETURN IF(CALCULATE([**bleep**. % of Total],FILTER(ALL(Table[Company]),[Rank]<_rx))<0.8,1,0)

VahidDM
Super User
Super User

HI @vijay273162 

 

Do you want to change the condition or just add an exception for GM?

 

To change the condition:

[IF 80 %] = IF([**bleep**. % of Total] <0.84,1,0)

 

to add an exception :

[IF 80 %] = IF(Max(Company])="GM",1,[**bleep**. % of Total] <0.84,1,0))

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

 

Thanks for reply.

 

If I apply filter, with IF condition, it return top 2 rows.

This will give me [% of total] row total as 61.11%. (only volvo & ford).

I need to get close to 80% or more as row total, (next row "GM" to get row total as 83.33 %.)

 

Hi @vijay273162 ,

 

Try to create a measure like below:

IF 80% = 
VAR MIN_ = MINX(ALL('Table'),ABS('Table'[cum %of total]-0.8))
VAR VALUE_ = CALCULATE('Table'[cum %of total],FILTER(ALL('Table'),ABS('Table'[cum %of total]-0.8)=MIN_))
RETURN IF([cum %of total]<=VALUE_,1,0)

Vlianlmsft_0-1642486712443.png

 


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

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.