Forum Discussion
Count Blanks Based on Two Columns Within Month
- Anonymous2 years ago
Thx for checking, but I ended up doing something much simpler:
CountBlanks = IF(ISBLANK([Gross Adds])&&ISBLANK([Device Upgrades]), 1, 0)Then I put in a measure to sum the CountBlanks:#DaysZero = SUMX(VALUES('Calendar'[CalendarDate]),[CountBlanks])
Hi Anonymous
The matrix does not currently support the ability to hide fields, so you can only make it appear empty
Please try this:
CountBlank =
VAR _currentCustomer =
SELECTEDVALUE ( 'Sales Table'[Customer] )
RETURN
IF (
NOT HASONEVALUE ( 'Sales Table'[Date] ),
CALCULATE (
COUNT ( 'Sales Table'[Date] ),
FILTER (
ALLSELECTED ( 'Sales Table' ),
'Sales Table'[Sales] = BLANK ()
&& 'Sales Table'[Upsales] = BLANK ()
&& 'Sales Table'[Customer] = _currentCustomer
)
)
)
The result is as follow:
For the sum column of Sumofeles and Sumofopsales, you can also create Messur to do the same, for example:
_Sales = IF(HASONEVALUE('Sales Table'[Date]),SUM('Sales Table'[Sales]))_Upsales = IF(HASONEVALUE('Sales Table'[Date]),SUM('Sales Table'[Upsales]))
The result is as follow:
Anonymous I got the code inputted with no errors, but in the Total I get the number 31 in all of the rows. So it's like it's saying there are blanks every day for the whole month.
- Anonymous2 years agoNot applicable
Hi Anonymous
Could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- Anonymous2 years agoNot applicable
Thx for checking, but I ended up doing something much simpler:
CountBlanks = IF(ISBLANK([Gross Adds])&&ISBLANK([Device Upgrades]), 1, 0)Then I put in a measure to sum the CountBlanks:#DaysZero = SUMX(VALUES('Calendar'[CalendarDate]),[CountBlanks])