I have a situation where I have a sales budget at a branch level but not a business segment level. I created a matrix with the hierarchy of branch then business segment. I want to display the budget when the matrix is at it’s highest level (branch) but hide the budget column when a user drills to the next level in the hierarchy (business segment). This is complicated by the fact that we have a business segment slicer. I want to display the budget when there is no business segment selected in the slicer but hide the budget when a user selects a business segment.
What DAX expression would I use to enable this behavior?
Thank you for the response. I have never used IF(ISFILTERED(…)) logic before. The data model is rather complicated as I am calculating a few different revenue related KPI’s on the same report. This tab of the report focuses on sales growth and each profit center has a goal based on the percent change of YTD sales from LYTD sales.
In the matix I drilled to single location to show the hierarchy (1. Profit Center 2.Business Segment) and the issue. We want to display the sales goal at the highest level in the hierarchy but show blank() for the second level of the hierarchy. The formula for the goal is rather simple right now:
Sales Goal 2018 = if(
sum('FinanceGoals2018'[2018 Revenue Goal])=0
,BLANK()
,iferror(
sum('FinanceGoals2018'[2018 Revenue Goal])/sum('FinanceGoals2018'[2017
Revenue])-1
,BLANK()
)
)
I just tried this formula but the entire column became blank:
Sales Goal 2018 = if(ISFILTERED(GL_Structure[Segment])
,BLANK()
,if(
sum('FinanceGoals2018'[2018 Revenue Goal])=0
,BLANK()
,iferror(
sum('FinanceGoals2018'[2018 Revenue Goal])/sum('FinanceGoals2018'[2017 Revenue])-1
,BLANK()
)
)
I actually got this to work. My problem was that the highest level of the hierarchy was a profit center (fact attribute) rather than branch (dimension attribute). My goals are all at the branch level so I replaced profit center with branch the formula worked.
Thanks for pointing me in the right direction for data modeling in Power BI. I will review the course videos and see what I can do to simplify the data model.