Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi all,
I am having an issue with IF.
I created a measure that works correctly:
Solved! Go to Solution.
@Jack2of3 I have looked into ot and it seems that you got mixed up between measure and calculated column.
While Project Milestone Attainment is a measure, Attainment is used as a calculated column.
Which is why it does not give you the expected result. I understand that you need that as a calculated column becuase you need to use that as a legend. In that case, simply creating calculate column based on a meaure would not give you what you need.
One of the ways to do it is by building a table like tfollowing
Table =
SUMMARIZECOLUMNS (
MBIS_PROJ_MILESTONES_V[FISCAL_YR],
MBIS_PROJ_MILESTONES_V[SLT_NAME],
MBIS_PROJ_MILESTONES_V[Quarter],
MBIS_PROJ_MILESTONES_V[ACTIVE_FLAG],
"_attainment", [_Attainment],
"Project Milestone Attainment", [Project Milestone Attainment]
)
Hi @Jack2of3
Is [Project Milestone Attainment] a measure? if yes, can you share a formula you used for it?
and is it possible to share a sample of your data in a text format with the desired result?
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Attainment =
SWITCH (
TRUE (),
MBIS_PROJ_MILESTONES_V[Project Milestone Attainment] < .7, "Needs Improvement",
MBIS_PROJ_MILESTONES_V[Project Milestone Attainment] >= .7
&& MBIS_PROJ_MILESTONES_V[Project Milestone Attainment] < .9, "Good",
MBIS_PROJ_MILESTONES_V[Project Milestone Attainment] >= .9, "Excellent"
)
I was hopeful🤔
All of the logic should work.
I expanded and sorted the decimal values just to ensure no rounding issues (picking at straws) and got this as the result:
Weird!
@Jack2of3 is it a measure or calculate column ?
The Value I am checking is a measure, The reulting data is a column.
I need it to be a column to use in donuts, pies etc.
@Jack2of3 can you provide a small sample pbix please?
@Jack2of3 I have looked into ot and it seems that you got mixed up between measure and calculated column.
While Project Milestone Attainment is a measure, Attainment is used as a calculated column.
Which is why it does not give you the expected result. I understand that you need that as a calculated column becuase you need to use that as a legend. In that case, simply creating calculate column based on a meaure would not give you what you need.
One of the ways to do it is by building a table like tfollowing
Table =
SUMMARIZECOLUMNS (
MBIS_PROJ_MILESTONES_V[FISCAL_YR],
MBIS_PROJ_MILESTONES_V[SLT_NAME],
MBIS_PROJ_MILESTONES_V[Quarter],
MBIS_PROJ_MILESTONES_V[ACTIVE_FLAG],
"_attainment", [_Attainment],
"Project Milestone Attainment", [Project Milestone Attainment]
)
@smpa01 Thanks for that. I realized last night while watching the Matrix movie (not easy to follow) that the calculated column was doing averages and then decided to create a dimensional table with the three Attainmnet values. I have not tried my solution as yet but the one you provided does work.
Thank you for the response unfortunately it gave the same result as the IF for the COLUMN.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
8 |