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.
Below left is example of my data set. I want to create the visual on the right. I can create everything except the % Sales measure. I feel like I'm close but I'm not an expert and need help!
I feel like I need to do something in the denominator of the DIVIDE, somehow keeping the filters for Location, Category, Attribute Type, and Attribute (although note that Attribute is not shown in visual), but NOT filtering on the Attribute Value. In other words, the denominator needs to include both the positive and negative Attribute Values...AKA the whole Attribute.
Help!
-Mike
Solved! Go to Solution.
You can put the fields into the table visual , then apply the following visual filters:
Then you can create a new measure, the code is as follows:
%Sales = var a=FILTER(ALL('Table'),'Table'[Attribute]=SELECTEDVALUE('Table'[Attribute])) var b=FILTER(ALL('Table'),'Table'[Attribute]=SELECTEDVALUE('Table'[Attribute])&&CONTAINSSTRING('Table'[Attribute Value],"Not")=FALSE()) return DIVIDE(SUMX(b,[Sales]),SUMX(a,[Sales]))
Output:
Best Regards,
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can put the fields into the table visual , then apply the following visual filters:
Then you can create a new measure, the code is as follows:
%Sales = var a=FILTER(ALL('Table'),'Table'[Attribute]=SELECTEDVALUE('Table'[Attribute])) var b=FILTER(ALL('Table'),'Table'[Attribute]=SELECTEDVALUE('Table'[Attribute])&&CONTAINSSTRING('Table'[Attribute Value],"Not")=FALSE()) return DIVIDE(SUMX(b,[Sales]),SUMX(a,[Sales]))
Output:
Best Regards,
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much!! This worked! 🙂
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |