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
netanel
Post Prodigy
Post Prodigy

Gross + If

Hi All!

 

I have this measure:

Gross USD=CALCULATE( DIVIDE( SUM( 'DB 2021'[Gross USD] ), COUNTROWS( 'Date' ) ),

   keepfilters(  'Date'[Date] < TODAY()))

 

And I want to put the following condition into it:

If the Source = "Amn" then bring me both Gross USD and Fee
Otherwise just bring me Gross USD

Source condition.JPG

 

 

 

 

 

 

 

 

 

Thanks for the helpers!








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki
1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @netanel ,

 

You can try below code:-

Gross USD =
IF (
    SELECTEDVALUE ( 'Table'[Source] ) = "Amn",
    CALCULATE (
        DIVIDE (
            ( SUM ( 'DB 2021'[Gross USD] ) + SUM ( 'DB 2021'[Fee] ) ),
            COUNTROWS ( 'Date' )
        ),
        KEEPFILTERS ( 'Date'[Date] < TODAY () )
    ),
    CALCULATE (
        DIVIDE ( SUM ( 'DB 2021'[Gross USD] ), COUNTROWS ( 'Date' ) ),
        KEEPFILTERS ( 'Date'[Date] < TODAY () )
    )
)

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

4 REPLIES 4
Samarth_18
Community Champion
Community Champion

Hi @netanel ,

 

You can try below code:-

Gross USD =
IF (
    SELECTEDVALUE ( 'Table'[Source] ) = "Amn",
    CALCULATE (
        DIVIDE (
            ( SUM ( 'DB 2021'[Gross USD] ) + SUM ( 'DB 2021'[Fee] ) ),
            COUNTROWS ( 'Date' )
        ),
        KEEPFILTERS ( 'Date'[Date] < TODAY () )
    ),
    CALCULATE (
        DIVIDE ( SUM ( 'DB 2021'[Gross USD] ), COUNTROWS ( 'Date' ) ),
        KEEPFILTERS ( 'Date'[Date] < TODAY () )
    )
)

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

ValtteriN
Super User
Super User

Hi,

You can include IF to your Fee measure. So something like this
Measure = IF(SELECTEDVALUE('Table'[Source])<>"Amn",BLANK(),[FEE])

With this the measure will display blank if the Source is something besides Amn. I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!





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

Proud to be a Super User!




Hi @ValtteriN 

 

I'm really getting close to the result in the idea you proposed
Only at the end of the formula:
Measure = IF (SELECTEDVALUE ('Table' [Source]) <> "Amn", BLANK (), [FEE])

What is marked in pink is a column in a table and not a formula
How to bring it?








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki

Hi,

Then you can just use the same logic with that column:
Measure = IF (SELECTEDVALUE ('Table' [Source]) <> "Amn", BLANK (), SELECTEDVALUE('Table'[FEE]))





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

Proud to be a Super User!




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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.