The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Everyone,
So, I want replace the blank cell with the "-".
I am using multple formula to filter out the field.
To calculate the BudgetHourYTD I am using this below formula
Solved! Go to Solution.
Hi @atasgao ,
Please try the following formula:
ALLBlankRows =
[YTD Budget Hours] = BLANK ()
&& [YTD Actual Hours] = BLANK ()
&& [YTD Hours Variance] = BLANK ()
&& [Annual Budget Hours] = BLANK ()
Replace_YTD_Budget = IF ( [ALLBlankRows], BLANK (), COALESCE ( [YTD Actual Hours], "-" ) )
Replace_YTD_Actual = IF ( [ALLBlankRows], BLANK (), COALESCE ( [YTD Actual Hours], "-" ) )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Depending on your data model you can try:
- Measure = IF(ISBLANK ( [BudgetHourYTD], "-", [BudgetHourYTD]) )
Note that will be a variable data type measure so can't be used in some totals, calculations, etc. It may also give you more rows in your matrix than you wish so you may need to add further filters into your IF statement.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi @atasgao ,
If the Business Unit rows you want to hide remains hidden after the replacement, then you can try the following way.
1. Create measure to filter out the rows of Business Unit that are not all null.
Measure =
var unit = VALUES ( FactLaborActualHourBV[Employee Labor Business Unit] )
var NotBlankRows =
CALCULATETABLE (
VALUES ( FactLaborActualHourBV[Employee Labor Business Unit] ),
FILTER (
ALLSELECTED ( FactLaborActualHourBV[Employee Labor Business Unit] ),
[YTD Budget Hours] <> BLANK()
|| [YTD Actual Hours] <> BLANK()
|| [Annual Budget Hours] <> BLANK()
|| [YTD Hours Variance] <> BLANK()
)
)
return
COUNTROWS ( INTERSECT ( unit, NotBlankRows ) )
2. Then use the measure to filter the Business Unit column in the visual.
3. Then replace the blank values.
NonBlank YTD Budget = COALESCE ( [YTD Budget Hours], "-" )
NonBlank YTD Actual = COALESCE ( [YTD Actual Hours], "-" )
4. The final result is:
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-kkf-msft It's working but the problem is under the employee labor business unit it is giving all the employee name irrespectively of wheater we have data or not.
Thanks,
Aakanksha
Hi @atasgao ,
Please try the following formula:
ALLBlankRows =
[YTD Budget Hours] = BLANK ()
&& [YTD Actual Hours] = BLANK ()
&& [YTD Hours Variance] = BLANK ()
&& [Annual Budget Hours] = BLANK ()
Replace_YTD_Budget = IF ( [ALLBlankRows], BLANK (), COALESCE ( [YTD Actual Hours], "-" ) )
Replace_YTD_Actual = IF ( [ALLBlankRows], BLANK (), COALESCE ( [YTD Actual Hours], "-" ) )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.