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
luis_pflucker
Helper I
Helper I

not getting right values

Hi, 

I am trying to calculate a column based in a measure but not getting as I want:

Measure = sum(History[_ReTested (RFRT-Assigned) #])
Column 2 = if([Measure]=0,"0 reopened",if([Measure]=1,"1 reopened",if([Measure]=2,"2 reopened","more than 2")))
Should I get in Column 2 in the 2 first rows as a result: "2 reopened" ?? 
See attached/below the table with the result.
luis_pflucker_0-1631894061043.png

regards

Luis

5 REPLIES 5
goncalogeraldes
Super User
Super User

Hello there @luis_pflucker ! Why are you using a calculated column instead of another measure? Try this:

Measure = 
var _open = sum(History[_ReTested (RFRT-Assigned) #])

return
SWITCH( _open,
0, "0 reopened",
1, "1 reopened",
2, "2 reopened",
"more than 2")

Hope this answer solves your problem! If you need any additional help please @ me in your reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

Thanks Gonçalo, it helped, but with a measure i am not able to build a clustered chart, because is no way to put this measure in legend:

 

Capture.PNG

Hello there @luis_pflucker ! SInce that is the case, use a "Calculated Column" with the same formula and I think you can get your desired result.

 

Hope this answer solves your problem! If you need any additional help please @ me in your reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

Hi Goncalo,

I tried but no getting as I want, calculated column is:

_ReTested (RFRT-Assigned) # = if(and(History[History New Value]="Assigned",History[History Old Value]="Ready_for_ReTest"),1,0)
It is counting  but not differentiate 2 reopens, 1 reopens, etc.
 
Capture.PNG

@luis_pflucker according to your print it is not counting but rather summing the values. Could it be that? 

 

For additional help, please @ me in your reply!
You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

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.