The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi Power BI Community,
I have a raw data table as follow:
Country | Region | Cat |
Albania | AL1 | L |
Albania | AL2 | M |
Albania | AL3 | M |
Albania | AL4 | M |
Albania | AL5 | L |
Albania | AL6 | L |
Bahrain | BH1 | M |
Bahrain | BH2 | M |
Bahrain | BH3 | M |
Bahrain | BH4 | L |
Denmark | DN1 | M |
Denmark | DN2 | L |
Denmark | DN3 | M |
Kazakhstan | KA1 | M |
Kazakhstan | KA2 | L |
Kazakhstan | KA3 | L |
Kazakhstan | KA4 | L |
Kazakhstan | KA5 | L |
South Africa | SA1 | M |
South Africa | SA2 | M |
South Africa | SA3 | L |
South Africa | SA4 | M |
South Africa | SA5 | L |
South Africa | SA6 | L |
South Africa | SA7 | L |
This is what I would like to do:
(1) To check if each Country has at least two "L" AND two "M". If Yes, then the countries are meeting the criteria and will be given a "Met" criteria. If No, then the countries will be given a "Unmet" criteria, as follow.
Intended Sumary-1 | |
Country | Criteria |
Albania | Met |
Bahrain | Unmet |
Denmark | Unmet |
Kazakhstan | Unmet |
South Africa | Met |
(2) From here, I would then like to count how many countries met the criteria. In this case, the answer should be 2 countries. From there, I would be able to calculate % of countries met, which is 2/6 = 33%. This is where I got stuck. Would appreciate your help greatly. Many thanks!
Solved! Go to Solution.
@awiefoong , Create a new measure like
Criteria =
if( isblank(countx(filter(summarize(Table, Table[Country], "_1", calculate(countrows(Table[Country]), filter(Table, Table[Cat] ="L")), "_2", calculate(countrows(Table[Country]), filter(Table, Table[Cat] ="M"))), [_1] >=2 && [_2] >=2 ), [Country])), "Unmet","Met")
@awiefoong , Create a new measure like
Criteria =
if( isblank(countx(filter(summarize(Table, Table[Country], "_1", calculate(countrows(Table[Country]), filter(Table, Table[Cat] ="L")), "_2", calculate(countrows(Table[Country]), filter(Table, Table[Cat] ="M"))), [_1] >=2 && [_2] >=2 ), [Country])), "Unmet","Met")
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |