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.
Hi all,
I have a measure that should only be calculated if an attribute is chosen and I have some issues trying to implement it.
The requirement is that I should display a message like "Select a attribute" in case the field is not chosen.
So what I've been working with was:
Solved! Go to Solution.
Hi, @lucas105
Based on your description, I created data to reproduce the scenario.
You may create a measure as follows.
Measure = IF(
SUM('Table'[Column])>0,
IF(
ISFILTERED('Table'[Attribute]),
SUM('Table'[Column]),
IF(
COUNTROWS('Table')=CALCULATE(COUNTROWS('Table'),ALL('Table')),
SUM('Table'[Column]),
"Select a attribute"
)
)
)
Result:
If I misunderstand your thought, please show me your sample data and expected output. I am glad to solve the problem for you.
Best Regards,
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @lucas105
Based on your description, I created data to reproduce the scenario.
You may create a measure as follows.
Measure = IF(
SUM('Table'[Column])>0,
IF(
ISFILTERED('Table'[Attribute]),
SUM('Table'[Column]),
IF(
COUNTROWS('Table')=CALCULATE(COUNTROWS('Table'),ALL('Table')),
SUM('Table'[Column]),
"Select a attribute"
)
)
)
Result:
If I misunderstand your thought, please show me your sample data and expected output. I am glad to solve the problem for you.
Best Regards,
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
thank you for your reply, but that's not exactly what I wanted to achieve.
My desired result would be that you wouldn't display a Total value at all if there's no attribute selected. I have values that are not additive across those attributes.
So if you'd choose a B, you'd see both row with B value and Total with same value.
If you'd add Attribute and a Metric summing Values to the table visual, you'd see "Select an attribute" in row values and in total row, you can either show same or nothing at all.
Best,
Luc
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 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |