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.
Hello All o/
Am attempting to create a SUMX measure when a particular table field is from a certain source. Below is where I'm currently at but am uncertain how to reference that field, or if this is the most efficient way to create this sumx measure.
WROR.Item_Total =
VAR TEAMSource = IF(tbl_Orders_LineItemDetails[SOURCE]="TEAMUK",TRUE,FALSE)
VAR TRUECALC = SUMX(tbl_Orders_LineItemDetails,(tbl_Orders_LineItemDetails[QTY]-tbl_Orders_LineItemDetails[QTYSUB])*tbl_Orders_LineItemDetails[Actual_Price.Disc])*1.5
VAR FALSECALC = SUMX(tbl_Orders_LineItemDetails,tbl_Orders_LineItemDetails[QTY]*tbl_Orders_LineItemDetails[Actual_Price.Disc])
RETURN IF(TEAMSource=TRUE,TRUECALC,FALSECALC)
Thanks for the help
Solved! Go to Solution.
WROR.Item_Total =
VAR TEAMSource = IF(SELECTEDVALUE(tbl_Orders_LineItemDetails[SOURCE],"Neg")="TEAMUK",TRUE,FALSE)
VAR TRUECALC = SUMX(tbl_Orders_LineItemDetails,(tbl_Orders_LineItemDetails[ITEMTOTAL])*1.5)
VAR FALSECALC = SUMX(tbl_Orders_LineItemDetails,(tbl_Orders_LineItemDetails[ITEMTOTAL])*1)
RETURN IF(TEAMSource=TRUE,TRUECALC,FALSECALC)
That seems to have done it.
@DataUsurper it is not very clear what you are trying to achieve, post some sample data with exepcted output to provide the solution.
Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@DataUsurper thanks for sharing pbix but it doesn't help as I don;t know what you are trying to achieve. You need to provide explanation based on your dataset what you are looking to achieve.
Unfortunately I don't have any magic wand to provide the solution without knowing what you need help with 🙂
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
It's rather quite simple
This would be an easy calcualted column, much like in excel
IF(Source="A", Calc1,Calc2)
As in the image I provided, along with the code, when I insert the logic check for source it says it isn't relatable. Did you view the image or look at the code I provided?
WROR.Item_Total =
VAR TEAMSource = IF(SELECTEDVALUE(tbl_Orders_LineItemDetails[SOURCE],"Neg")="TEAMUK",TRUE,FALSE)
VAR TRUECALC = SUMX(tbl_Orders_LineItemDetails,(tbl_Orders_LineItemDetails[ITEMTOTAL])*1.5)
VAR FALSECALC = SUMX(tbl_Orders_LineItemDetails,(tbl_Orders_LineItemDetails[ITEMTOTAL])*1)
RETURN IF(TEAMSource=TRUE,TRUECALC,FALSECALC)
That seems to have done it.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
78 | |
75 | |
50 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |