cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

A measure with 3 conditionals diferent

Hi i´m new here i learn a lot in this forum,i have a question that i could found anywhere so here is
i have 2 measures A an B both are COUNTS of id and B the same but have a filter so
MeasureA > Measure B 

then i have a rowC wich have 3 diferent values (1,2 and 3)

so my question is there is a way that i could make the following next measure?

MeasureNew
if value rowC is 1 then measureA-MeasureB

if value rowC is 2 then measureA

if value rowC is 3 then measureA+MeasureB

is for a visual that have to show nor a matrix.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate I
Advocate I

Re: A measure with 3 conditionals diferent

Hi, 

try this

 

Measure = IF(
SELECTEDVALUE(RowC) = 1,
[MeasureA] - [MeasureB],
IF(
SELECTEDVALUE(RowC) = 2,
[MeasureA],
IF(
SELECTEDVALUE(RowC) = 3,
[MeasureA] + [MeasureB]
)
)
)

View solution in original post

5 REPLIES 5
Highlighted
Impactful Individual
Impactful Individual

Re: A measure with 3 conditionals diferent

try this

 

Measure = SWITCH(TRUE(),
                    [RowC] = 1, [MeasureA] - [MeasureB],
                    [RowC] = 2, [MeasureA],
                    [RowC] = 3 , [MeasureA] + [MeasureB])
Highlighted
Anonymous
Not applicable

Re: A measure with 3 conditionals diferent

Hi rocky this solutuon don"t work... I think because the swich formula doesn't let me put rowC because is not a measure is a row of a table.
Highlighted
Community Support
Community Support

Re: A measure with 3 conditionals diferent

Hi @Anonymous ,

 

Could you please share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Highlighted
Anonymous
Not applicable

Re: A measure with 3 conditionals diferent

I @v-frfei-msft have a issue about confidenciality so i gonna try to put images to make a better explanation (all is in a same table):

First image a measure that counts id but with a filter of a row called MATRIZ RC wich have 3 values yellow black and gray, the second image show a measure that also is a count with the same filter but with another filter wich is a column "yes or no" so what i need is create a new measure that follows in a visual:

 

NEWMEASURE:
Yellow1-Yellow2
black1
gray1 + gray2

so in my visual should be for "ENERO" (JANUARY) yellow =500 black= 61  and gray =150

i hope i get myself clear thanks for the attention.

 

tablas1.png
TABLAS2.png

Highlighted
Advocate I
Advocate I

Re: A measure with 3 conditionals diferent

Hi, 

try this

 

Measure = IF(
SELECTEDVALUE(RowC) = 1,
[MeasureA] - [MeasureB],
IF(
SELECTEDVALUE(RowC) = 2,
[MeasureA],
IF(
SELECTEDVALUE(RowC) = 3,
[MeasureA] + [MeasureB]
)
)
)

View solution in original post

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors