admin管理员组文章数量:1333451
I have bookmark page, “Sourcing area pie chart”, that has pie charts for all sourcing areas in our system. All the pie charts are filtered per sourcing area under “Filters” for the visuals. I have a measure that is dynamically adjusted.
For example if we have a pie chart filtered for sourcing area Y,
The user selects growing season X and there is data for Y in growing season X, then the title should show,
“Input cost % for Y in X” – case A
and in the case that there is no data for Y in growing season X it should show,
“No data available for Y” – case B
However, currently the measure only works with case A, and case B not. The issue seems to stem from if there is data for a sourcing area for a specific growing season. If there is, the measure works as intended, if there isn’t it does not work.
I am not sure what the issue is and how to fix it. I have made sure the slicer for sourcing is not affecting the pie chart, but the issue persists.
Measure used:
_SourcingareaPietitle =
IF(
ISBLANK(MAX('CAD$,T,Ha'[Growing Season])) ||
ISBLANK(SELECTEDVALUE('CAD$,T,Ha'[Delivery period])) ||
ISBLANK(SELECTEDVALUE('CAD$,T,Ha'[DataType])),
"No data available for " &
SELECTEDVALUE('CAD$,T,Ha'[Sourcing Area], MAX('CAD$,T,Ha'[Sourcing Area])),
"Input cost % for " &
SELECTEDVALUE('CAD$,T,Ha'[Sourcing Area], MAX('CAD$,T,Ha'[Sourcing Area])) &
" in " &
MAX('CAD$,T,Ha'[Growing Season])
)
I have bookmark page, “Sourcing area pie chart”, that has pie charts for all sourcing areas in our system. All the pie charts are filtered per sourcing area under “Filters” for the visuals. I have a measure that is dynamically adjusted.
For example if we have a pie chart filtered for sourcing area Y,
The user selects growing season X and there is data for Y in growing season X, then the title should show,
“Input cost % for Y in X” – case A
and in the case that there is no data for Y in growing season X it should show,
“No data available for Y” – case B
However, currently the measure only works with case A, and case B not. The issue seems to stem from if there is data for a sourcing area for a specific growing season. If there is, the measure works as intended, if there isn’t it does not work.
I am not sure what the issue is and how to fix it. I have made sure the slicer for sourcing is not affecting the pie chart, but the issue persists.
Measure used:
_SourcingareaPietitle =
IF(
ISBLANK(MAX('CAD$,T,Ha'[Growing Season])) ||
ISBLANK(SELECTEDVALUE('CAD$,T,Ha'[Delivery period])) ||
ISBLANK(SELECTEDVALUE('CAD$,T,Ha'[DataType])),
"No data available for " &
SELECTEDVALUE('CAD$,T,Ha'[Sourcing Area], MAX('CAD$,T,Ha'[Sourcing Area])),
"Input cost % for " &
SELECTEDVALUE('CAD$,T,Ha'[Sourcing Area], MAX('CAD$,T,Ha'[Sourcing Area])) &
" in " &
MAX('CAD$,T,Ha'[Growing Season])
)
Share
Improve this question
edited Nov 20, 2024 at 19:32
Amira Bedhiafi
1
asked Nov 20, 2024 at 17:49
Sadredin MahmoudiSadredin Mahmoudi
12 bronze badges
1 Answer
Reset to default 0I think you have a problem with the filtering context and how ISBLANK interacts with your model specifically, if no rows exist in the table for the given filtering combination, the measure may not evaluate as expected so you may try the below :
_SourcingareaPietitle =
IF(
ISBLANK(
CALCULATE(
MAX('CAD$,T,Ha'[Growing Season]),
REMOVEFILTERS('CAD$,T,Ha')
)
),
"No data available for " &
SELECTEDVALUE('CAD$,T,Ha'[Sourcing Area], MAX('CAD$,T,Ha'[Sourcing Area])),
"Input cost % for " &
SELECTEDVALUE('CAD$,T,Ha'[Sourcing Area], MAX('CAD$,T,Ha'[Sourcing Area])) &
" in " &
MAX('CAD$,T,Ha'[Growing Season])
)
版权声明:本文标题:dax - Measure in PowerBI not displaying title for pie chart properly when there is no data - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742339856a2456380.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论