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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Assistance in writing an IF statement

Hello,

 

I'm trying to write a formula which needs to include an IF statement.

 

Note:

"SharedHours" is a measure

"Percent" is a measure

 

Hours = CALCULATE([SharedHours],ALL(Clients))*[Percent]
 
I'm trying to create an IF statement specifically for the Client field, which is a table. I want the formula to state, 
Hours = CALCULATE([SharedHours],ALL(Clients)) EXCEPT "ABC" *[Percent]. In other words, I want the formula to calculate the Total Hours for all the clients, except one specific client. 
 
Can you please advise on how I can write this out? Thank you very much in advance.
 
 
1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @Anonymous ,

 

try the following approach. I assume the clients name would be in a column [ClientName] in the table Clients (Clients[ClientName]):

Hours =
CALCULATE(
    [SharedHours],
    ALL(Clients)),
    Clients[ClientName] <> "ABC"
) * [Percent]

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

1 REPLY 1
selimovd
Super User
Super User

Hey @Anonymous ,

 

try the following approach. I assume the clients name would be in a column [ClientName] in the table Clients (Clients[ClientName]):

Hours =
CALCULATE(
    [SharedHours],
    ALL(Clients)),
    Clients[ClientName] <> "ABC"
) * [Percent]

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.