The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Thanks for the helpers!
Solved! Go to Solution.
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
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
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!
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?
Hi,
Then you can just use the same logic with that column:
Measure = IF (SELECTEDVALUE ('Table' [Source]) <> "Amn", BLANK (), SELECTEDVALUE('Table'[FEE]))
Proud to be a Super User!
User | Count |
---|---|
15 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
23 | |
14 | |
13 | |
8 | |
8 |