Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I'm currently working on a combo chart visualising hours worked per department, actuals vs target. Hours is called HpT. I only want to show one department by default when opening the report and than be able to filter on another department.
I created the following to be able to get one of the department as default (29221 is the department):
As you can see in the picture, the actuals for department 29221 is showing but the line for target is not showing.
Thankful for support,
@AnnaML , Try like
FA1 Dep Target =
IF(COUNTROWS(DISTINCT(ALLSELECTED(Weekly[Department]))) < COUNTROWS(DISTINCT(ALL(Weekly[Department]))) , CALCULATE(SUM('Weekly'[HpT]), 'Weekly'[Scenario] IN { "Target" })
,
IF(countx(filter(allselected(Weekly) ,Weekly[Department] = "29221"),Weekly[Department) <> blank(),CALCULATE(SUM('Weekly'[HpT]), 'Weekly'[Scenario] IN { "Target" }) ))
Thanks for your answere. I tried and got the following:
Now I get the target line but for all departments and not just department "29221". Do you know what might be the problem?
Thanks in advance
Hi @AnnaML ,
FA1 Dep Target =
IF(COUNTROWS(DISTINCT(ALLSELECTED(Weekly[Department]))) < COUNTROWS(DISTINCT(ALL(Weekly[Department]))) , CALCULATE(SUM('Weekly'[HpT]), 'Weekly'[Scenario] IN { "Target" })
,
IF(SELECTEDVALUE(Weekly[Department])= "29221"),CALCULATE(SUM('Weekly'[HpT]), 'Weekly'[Scenario] IN { "Target" }) ))
If the measure still doesnt work,would you pls provide some sample data with expected output?
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.