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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JimmyBos
Helper II
Helper II

Calculated Column to Measure Gives many (unwanted) results

Hello all,

 

In my PBI file i am changing Calculated Columns to Measures. Am struggling to change the following:

 

At this moment i have a Calculated Column:

Uitgegeven = IF(POStuklijst[Checked] - POStuklijst[Completed] = 0 , "JA" , "NEE" )
 
The Measure i created which works (but gives many unwanted results):
Uitgegeven Measure =
var Checked = SELECTEDVALUE(POStuklijst[Checked])
VAR Completed = SELECTEDVALUE(POStuklijst[Completed])
RETURN IF(Checked - Completed = 0, "JA", "NEE")
 
So the file shows all parts used in a project. The Calculated Column i have shows "JA" or "NEE" for all parts in this project.
The Measure i tried shows many more rows with different parts. These parts are not used in the project and (obviously) show 'zero' for amount.
 
Does anyone know how to adjust the Measure so i get the same result as the Calculated Column? Thanks in advance!
1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @JimmyBos  - You need to ensure that the measure respects the row context like the calculated column

 

use the below measure:

Uitgegeven Measure =
VAR Checked = MAX(POStuklijst[Checked])
VAR Completed = MAX(POStuklijst[Completed])
RETURN
IF(Checked - Completed = 0, "JA", "NEE")

 

If you're seeing extra rows that aren't used in the project, try using a measure that excludes them

Uitgegeven Measure =
VAR Checked = MAX(POStuklijst[Checked])
VAR Completed = MAX(POStuklijst[Completed])
RETURN
IF( NOT(ISBLANK(Checked)) && NOT(ISBLANK(Completed)),
IF(Checked - Completed = 0, "JA", "NEE"),
BLANK()
)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
AnkitKukreja
Super User
Super User

Hi! @JimmyBos 

Please try this: 

Uitgegeven Measure =
IF(
SUMX(
POStuklijst,
IF(POStuklijst[Checked] - POStuklijst[Completed] = 0, 1, 0)
) = COUNTROWS(POStuklijst),
"JA",
"NEE"
)

 

OR

 


Uitgegeven Measure =
VAR CheckedSum = SUM(POStuklijst[Checked])
VAR CompletedSum = SUM(POStuklijst[Completed])
RETURN IF(CheckedSum - CompletedSum = 0, "JA", "NEE")

 

 

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904
rajendraongole1
Super User
Super User

Hi @JimmyBos  - You need to ensure that the measure respects the row context like the calculated column

 

use the below measure:

Uitgegeven Measure =
VAR Checked = MAX(POStuklijst[Checked])
VAR Completed = MAX(POStuklijst[Completed])
RETURN
IF(Checked - Completed = 0, "JA", "NEE")

 

If you're seeing extra rows that aren't used in the project, try using a measure that excludes them

Uitgegeven Measure =
VAR Checked = MAX(POStuklijst[Checked])
VAR Completed = MAX(POStuklijst[Completed])
RETURN
IF( NOT(ISBLANK(Checked)) && NOT(ISBLANK(Completed)),
IF(Checked - Completed = 0, "JA", "NEE"),
BLANK()
)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hello @rajendraongole1 , Thanks again! The second formula (with the ISBLANK) was the solution!

 

Ofcourse also thanks to @Deku  & @AnkitKukreja for their view on this problem.

Deku
Community Champion
Community Champion

Without more context the best I can suggest is

 

Uitgegeven Measure =

var Checked = sum(POStuklijst[Checked])

VAR Completed = sum(POStuklijst[Completed])

RETURN IF(Checked - Completed = 0, "JA", "NEE")

 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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