Forum Discussion
netanel
Post Prodigy
4 years agoGross + 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 condi...
- 4 years ago
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
netanel
Post Prodigy
4 years agoHi 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?
ValtteriN
Community Champion
4 years agoHi,
Then you can just use the same logic with that column:
Measure = IF (SELECTEDVALUE ('Table' [Source]) <> "Amn", BLANK (), SELECTEDVALUE('Table'[FEE]))