Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello everyone 🙂
Hope someone can help me with this one.
I need a measure that sums values from a columns depending on strings from another one.
A simple example:
measure= CALCULATE(SUM(Table[Column]); Table[0ther Column] = "Some string")
I need this measure but with more restrictions, like:
First I need the column to have this string: "String X"
THEN
I need the column to have these two: "String Y" AND "String Z"
I'm aware this might be a little confusing, I tried my best to explain it.
Thank you for your help
Alena
Hi @Anonymous
You have to use SUMX instead
@DataVitalizer Thank you for your reply 🙂
But what about "String X" that has to come before the other two?
@Anonymous
In the OR clause you can put as much restrictions as you want
@Anonymous it is surely confusing, better is to put sample data and expected output. 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.
@camargos88 @parry2k Yes, of course:
What I need is the sum of the column "PageViews" when the following conditions happen. First, must appear "Banana". Then, and only after "Banana" I need to have "Apple" and "Peach
So, from the data below, the measure should return 29 (7+10+12):
PageViews | PageName |
2 | BananaApple |
3 | OrangeBanana |
4 | BananaPineappleApple |
7 | OrangeBananaApplePeach |
10 | BananaOrangeAppleOrangePeach |
12 | BananaOrangePineappleApplePeach |
78 | Apple |
45 | Banana |
98 | X |
26 | Y |
87 | Z |
Thank you for your help
Hi @Anonymous ,
Try it:
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |