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

Combine column by if

Hello all

 

Simple scenario, but i cant figure out a solution by myself...

Have a table with 2 columns: [ValueWhenEven] and [ValueWhenOdd]

I should display the column that matches the next weeks number.

For example: Next week is no 14, this is even, so i should show [ValueWhenEven].

 

I though of creating a column with the following formula, but it does not work:

Combined = if(MOD(SELECTEDVALUE(DateTable[Week]);2) = 0; 'Operatives'[ValueWhenEven]; 'Operatives'[ValueWhenOdd])

I think this is because im using a column, so the value cant refresh itself.

Is there a way to do this with a measure?

 

FYI: It always shows the [ValueWhenEven] value

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Since it's a measure it can only go into the Values secttion. If you want to put it on rows/columns/slicers/etc is has to be a column in your data. Can be calculated column or a column that is created in Power Query. 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Works now with a measure like this:

Combined = IF([OddOrEven] = "even"; FIRSTNONBLANK('Operatives'[ValueWhenEven];TRUE());FIRSTNONBLANK('Operatives'[ValueWhenOdd]; TRUE()))

But i cant drag it into my matrix, is there a way to do that?

Anonymous
Not applicable

Since it's a measure it can only go into the Values secttion. If you want to put it on rows/columns/slicers/etc is has to be a column in your data. Can be calculated column or a column that is created in Power Query. 

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.