Forum Discussion

ViralPatel212's avatar
ViralPatel212
Resolver I
2 years ago
Solved

Sum total based on filter parameters

Hello Team,   I was hoping if you could help me.   I have a scenario where i am calculating the Total Volume based on the following scenario. 1) IF one currency is selected than show currency To...
  • amitchandak's avatar
    2 years ago

    ViralPatel212 , Try if this measure can help

     

    Total Volume =
    VAR _currencyCount = [currency count]
    VAR _buy = CALCULATE([MV Size Actual EUR], 'glimpse-prod-db output_file_dtl'[side] = "Buy")
    VAR _sell = CALCULATE([MV Size Actual EUR], 'glimpse-prod-db output_file_dtl'[side] = "Sell")
    VAR _total = _buy + _sell

    RETURN
    IF (
    _currencyCount >= 43,
    _total,
    IF (
    HASONEVALUE('glimpse-prod-db output_file_dtl'[side]),
    IF (
    SELECTEDVALUE('glimpse-prod-db output_file_dtl'[side]) = "Buy",
    _buy,
    _sell
    ),
    BLANK()
    )
    )