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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
netanel
Post Prodigy
Post Prodigy

Gross + if

Hi All!

 

I have a formula that I can not put together correctly

This is the first part of the formula that works great for me:

Gross USD average per Day =

CALCULATE(

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

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

)

 
Now I try to connect this condition:
If the Source = "Amn" then bring me both Gross USD and Fee
Otherwise just bring me Gross USD
Source condition.JPG
 







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

Thank you all!
This is the correct formula:

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







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

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

View solution in original post

4 REPLIES 4
netanel
Post Prodigy
Post Prodigy

Thank you all!
This is the correct formula:

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







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

Connect on Linkedin
linkedin.com/in/netanel-shriki
Tahreem24
Super User
Super User

@netanel  Try this measure:

MEASURE = IF(MAX(Table[Source])="Amn",SUM(Table[Fee])+SUM(Table[Gross USD]),SUM(Table[Gross USD]))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Hi @Tahreem24 

Thanks for the response,

this is also the direction I go
But he is without average
Take a look at my original formula for calculating the Gross

Gross USD average per Day =

CALCULATE(

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

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

)








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

Connect on Linkedin
linkedin.com/in/netanel-shriki
amitchandak
Super User
Super User

@netanel , not sure how that is related to avg gross

You need to have new fee measure

Fee m = calculate(sum('Revenue DB'[Fee]) , filter('Revenue DB', Source <> "Amn" ))

 

This will not show Fee for Source = "Amn"

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.