March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Dear All,
I have the folllwing situation:
I want to create a measure showing the result of two types of margins. Depending on the type of product, a certain margin percentage applies. I have simplyfied the sitution below:
The result should be a measure (in red) and is making use of a margin scheme which can be hardcoded in DAX. The margin scheme isn't a separate table,; it's just published to show the margin percentages used.
I am think to make use of a IF ELSE forumlua within DAX. Any other suggestion / solution is welcome.
Thanks!
Solved! Go to Solution.
@Anonymous create this caclulated column:
Result =
'Table'[price] * IF('Table'[Type = "Normal", 0.1, 0.2)
@Anonymous create this caclulated column:
Result =
'Table'[price] * IF('Table'[Type = "Normal", 0.1, 0.2)
Thanks again for your prossible solution.
However, when I run this formula, I get the message that I need to aggregate with Minimum, Maximum, Nummber of Sum function on field 'Table[Type]'. How can I solve this?
Thanks!
@Anonymous hey, just to make sure, cause I missed a columm bracket there, you tried:
Result =
'Table'[price] * IF('Table'[Type] = "Normal", 0.1, 0.2)
And you got that message?
That means you try to create a visaul and not a calculated column.
Try:
Result =
SUMX(
'Table',
'Table'[price] * IF('Table'[Type] = "Normal", 0.1, 0.2)
)
Thanks a lot for this additional suggestion.
However when I use this forumla, I still get a message that column / field [Type] in table 'Table' cannot be found, but this field is a field / column in table 'Table'.
Thanks for any additional suggestion
@Anonymous hey, will PM you now
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
105 | |
98 | |
65 | |
54 |