Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Amerv
Regular Visitor

Apply condition (For loop) from big data-set to create something similar to below.

I have a large dataset, and I need help to create something similar to show as the above where v99 to v 135 as rows ( where the condition == Yes), the first screenshot is showing the data with random names it. what I want to achieve is the screenshot below where. I tried this in Python and it is worked I want to do the same in Power bi . I hope that is help explain the issue.

 

raw data

Exp2 .PNG

 

The end result should be like that ( where v1 = Geo , and V2 = countries) 

EXP1.PNG

exp 3 python.PNG

1 REPLY 1
sturlaws
Resident Rockstar
Resident Rockstar

Hi, @Amerv

 

Have you considered the Power BI Python-visual. Be sure to check out the limitations though, if you dataset has more than 150.000 rows it will not work properly.

 

I also think DAX and Power BI will be able to solve this for you. First use power query(edit query) to pivot the table so that you get one row for each column name(you can call this column V). Then create a measure like this:
number of rows with yes = calculate(countrows(dataset);filter(dataset;valueColumn="yes").

Then add a matrix-visual to the canvas and add countries on the column-axis and V on the row-axis.
If you upload a small sample dataset, I can show you have to do it.

cheers,

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors