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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
8eon145
Frequent Visitor

Replacing measured value if condition met

8eon145_0-1691524037325.png

I can only work with measured fields since I'm working with live data and don't have an actual dataset. I need to replace count values that are not 1 (the 4s and 2s) with 1. I need to do this because it is inflating the value of the count total. These counts are greater than 1 because they share the same TD_ENTRY_ID value (first column).

 

My condition is IF "Counting test" is greater than 1, THEN replace the "Counting test" value with 1. 

 

Basically, what I am looking for is all "Counting test" values to be 1.

 

8 REPLIES 8
AnthonyGenovese
Resolver III
Resolver III

What should the total be? Total doesnt mean "Sum everything in the column". It means, run the formula without any of the filters on the table applied. 

AnthonyGenovese
Resolver III
Resolver III

If([Counting test]>1,1,[counting test])

 

If this post was helpful, please kudos or accept the answer as a solution.
~ Anthony Genovese
Need more PBI help? PM me for affordable, dedicated training or consultant recomendations!

Thanks for your reply. 

8eon145_0-1691526043263.png

I tried this out and it doesn't necessary replace the count value. Instead, I have a new column in my table visualization that returns 1 if condition is met. As you can see, I still have 4s and 2s in my count column.

 

What is the formula for counting test?

Here is the formula

 

8eon145_0-1691526337147.png

Is there a way to integrate the "Count greater than one" measure? So that it replaces values within the "Counting test" measure?

 

8eon145_1-1691526392260.png

 

Yes, instead of a screen shot, give me the text and I will get it for you. 


@AnthonyGenovese wrote:

Yes, instead of a screen shot, give me the text and I will get it for you. 


Counting test = COUNTROWS(FILTER(CM_TD_VW, CM_TD_VW[ROLE_ID] = "DOU-UB-AT" && CM_TD_VW[Days Over SLA (Master)] > 0 && (CM_TD_VW[STATUS] = "Being Worked On" || CM_TD_VW[STATUS] = "Open")))
 
 
Count greater than one = IF([Counting test] > 1, 1)

Counting test =
var ctest=COUNTROWS(FILTER(CM_TD_VW, CM_TD_VW[ROLE_ID] = "DOU-UB-AT" && CM_TD_VW[Days Over SLA (Master)] > 0 && (CM_TD_VW[STATUS] = "Being Worked On" || CM_TD_VW[STATUS] = "Open")))
var result = if(ctest>1,1,ctest)
return result

If this post was helpful, please kudos or accept the answer as a solution.
~ Anthony Genovese
Need more PBI help? PM me for affordable, dedicated training or consultant recomendations!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.