Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
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
Anonymous
Not applicable

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
Anonymous
Not applicable

Hi, 

try this

 

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

try this

 

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

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.

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.
Anonymous
Not applicable

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.