Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi Team
I have below dataset:
City | Value1 | Value2 |
Delhi | Yes | |
Delhi | No | Na |
Delhi | No | Yes |
Delhi | NA | No |
Mumbai | Yes | No |
Mumbai | Yes | No |
Mumbai | No | NA |
Mumbai | No | NA |
Bangalore | Yes | na |
Bangalore | no | na |
Bangalore | No | |
Bangalore | no | Yes |
I want to return below output in a card visual using measure :
No of locations where Value1 and value2 is Yes , output would be 2 here
Delhi and Bangalore has Value1 and Value2 Yes where mumbai has Value 1 yes but no rows has value2 as yes.
@Greg_Deckler @tamerj1 @johnt75 @Jihwan_Kim @Wilson_
Solved! Go to Solution.
hi @Anonymous
the data is exactly from you and i only name it as data. all others are included in the previous replies.
hi @Anonymous
try to plot a card visual with a measure like:
Measure =
VAR _table =
ADDCOLUMNS(
VALUES(Data[City]),
"Value1",
CALCULATE(MAX(Data[Value1])),
"Value2",
CALCULATE(MAX(Data[Value2]))
)
RETURN
COUNTROWS(
FILTER(
_table,
[Value1]="Yes"&&[Value2]="Yes"
)
)
it worked like:
Thank you for the promt response unfortunately its not working. I just gave dummy data but Value1 and value2 has other data apart from NA, No so Max fucntion is capturing those values instead Yes.
how to explicit call Yes as Max fucntion giving some other output
hi @Anonymous
then try like:
Measure =
VAR _table =
GENERATE(
VALUES(Data[City]),
CALCULATETABLE(
CROSSJOIN(VALUES(Data[Value1]), VALUES(Data[Value2]))
)
)
RETURN
COUNTROWS(
FILTER(
_table,
[Value1]="Yes"&&[Value2]="Yes"
)
)
it worked like:
hi @Anonymous
the data is exactly from you and i only name it as data. all others are included in the previous replies.
Its working, thanks buddy!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |