Forum Discussion
Mariollo
1 year agoHelper I
How to Count Values From Column Where Values In Other Column Are Empty
Hello everyone, I am working on a Power BI report and need some help creating a DAX measure. Here's the scenario: I have a dataset with the following columns: COUNTRY CITY ATTRIBUTE PRODUCT ...
- 1 year ago
Hi Mariollo ,
You can achieve your goal by this measure:
UniqueEmptyProductCities = CALCULATE( COUNTROWS( FILTER( VALUES('Table'[CITY]), CALCULATE( COUNTROWS('Table'), NOT(ISBLANK('Table'[PRODUCT])) ) = 0 ) ) )As you can see bellow, in the card, the result is 1 and in the table the result was LONDON:
Bibiano_Geraldo
1 year agoSuper User
Hi Mariollo ,
You can achieve your goal by this measure:
UniqueEmptyProductCities =
CALCULATE(
COUNTROWS(
FILTER(
VALUES('Table'[CITY]),
CALCULATE(
COUNTROWS('Table'),
NOT(ISBLANK('Table'[PRODUCT]))
) = 0
)
)
)
As you can see bellow, in the card, the result is 1 and in the table the result was LONDON:
- Mariollo1 year agoHelper I
This one works, but I simplified too much my data.
What if I have many other columns with attributes for each product?
(Updated first post)
- Bibiano_Geraldo1 year agoSuper User
It will work, because we're using only the column of city and product to reach our goal.
try out and give me a feedback.
Thank you