cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TheBaz_57
Frequent Visitor

Can this 3 calculations can be done in one ?

Hi all,

 

I have this 3 calculation:

Coll.V. 1S = CALCULATE(SUM('Master June 2021'[Value (USD)]),'Master June 2021'[Nb Liquidity Sources]=1)
Coll.V. 2S = CALCULATE(SUM('Master June 2021'[Value (USD)]),'Master June 2021'[Nb Liquidity Sources]>=2)/2
 
Real = 'Master June 2021'[Coll.V. 1S]+'Master June 2021'[Coll.V. 2S]
 
Can this be done in one shot?
 
Thanks
1 ACCEPTED SOLUTION
rohit_singh
Solution Sage
Solution Sage

Hi @TheBaz_57 ,

Please create a new measure and try this :

Real =

var _Coll.V.1S = CALCULATE(SUM('Master June 2021'[Value (USD)]),'Master June 2021'[Nb Liquidity Sources]=1)
var _Coll.V.2S = CALCULATE(SUM('Master June 2021'[Value (USD)]),'Master June 2021'[Nb Liquidity Sources]>=2)/2

RETURN
_Coll.V.1S+_Coll.V.2S
 

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊

View solution in original post

2 REPLIES 2
vojtechsima
Super User
Super User

Hi, @TheBaz_57 ,
Sure, basically you just put "var" as a variable in front of each name and return it by calling one of the variable.

var Coll.V. 1S = CALCULATE(SUM('Master June 2021'[Value (USD)]),'Master June 2021'[Nb Liquidity Sources]=1)
var Coll.V. 2S = CALCULATE(SUM('Master June 2021'[Value (USD)]),'Master June 2021'[Nb Liquidity Sources]>=2)/2
 
var Real = 'Master June 2021'[Coll.V. 1S]+'Master June 2021'[Coll.V. 2S]
return Real

 

rohit_singh
Solution Sage
Solution Sage

Hi @TheBaz_57 ,

Please create a new measure and try this :

Real =

var _Coll.V.1S = CALCULATE(SUM('Master June 2021'[Value (USD)]),'Master June 2021'[Nb Liquidity Sources]=1)
var _Coll.V.2S = CALCULATE(SUM('Master June 2021'[Value (USD)]),'Master June 2021'[Nb Liquidity Sources]>=2)/2

RETURN
_Coll.V.1S+_Coll.V.2S
 

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors