Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi all,
Im looking for a solution to my problem. I want to do some divide with two statements in denominator like:
Solved! Go to Solution.
Hey @Anonymous ,
do you use it as a calculated column or as a measure?
As you wrote it the first post it looked like a calulcated column. Then my formula should work. If you use it as a measure, you have to add an aggregation. Then the following should work:
MyMeasure =
DIVIDE(
COUNTROWS( 'Invoices' ),
IF(
MAX( 'Invoices'[Team] ) = "A",
9,
10
)
)
The formula dosent work. Can it be due to the fact that my refference column (Team) is a Custom made column with formula inside?
Hey @Anonymous ,
yes, that's absolutely possible.
The following approach should work:
MyMeasure =
DIVIDE(
COUNTROWS( 'Invoices' ),
IF(
'Invoices'[Team] = "A",
9,
10
)
)
You could also put it in a variable if you want to, but here that is not necessary:
MyMeasure =
VAR vIfValue =
IF(
'Invoices'[Team] = "A",
9,
10
)
RETURN
DIVIDE(
COUNTROWS( 'Invoices' ),
vIfValue
)
The formula dosent work. Can it be due to the fact that my refference column (Team) is a Custom made column with formula inside?
@selimovd do you maybe know, why it is not working? I cant do reference to a column in this part of your code:
IF( 'Invoices'[Team] = "A", 9, 10
I can make after IF(... reference to another formula or measure....
Hey @Anonymous ,
do you use it as a calculated column or as a measure?
As you wrote it the first post it looked like a calulcated column. Then my formula should work. If you use it as a measure, you have to add an aggregation. Then the following should work:
MyMeasure =
DIVIDE(
COUNTROWS( 'Invoices' ),
IF(
MAX( 'Invoices'[Team] ) = "A",
9,
10
)
)
Thanks! It works!
User | Count |
---|---|
16 | |
14 | |
13 | |
12 | |
11 |
User | Count |
---|---|
19 | |
16 | |
15 | |
11 | |
9 |