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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Pivot transformation

Hello

 

I have the data:

 

Field1Field2Field3Field4Attribute1Attribute2Attribute3
1234  Yes
2344YesYes 
3454 Yes 

 

I want to transform the above into:

 Attribute1Attribute2Attribute3
 Yes(blank)Yes(blank)Yes(blank)
Count of Field1 where Field2 is >2112000

 

I would like to do that with Measures or DAX rather than Power Query, any idea?

 

Thanks!

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Please refer to my pbix file to see if it helps you.

Create columns.

blank_1 =
CALCULATE (
    COUNT ( 'Table'[Field1] ),
    'Table'[Field2] > 2
        && 'Table'[Attribute1] = BLANK ()
)
_1yes =
VAR _count =
    CALCULATE (
        COUNT ( 'Table'[Field1] ),
        FILTER ( 'Table', 'Table'[Field2] > 2 && 'Table'[Attribute1] = "Yes" )
    )
RETURN
    IF ( 'Table'[Attribute1] = "Yes", _count, BLANK () )
blank_2 =
CALCULATE (
    COUNT ( 'Table'[Field1] ),
    FILTER ( 'Table', 'Table'[Field2] > 2 && 'Table'[Attribute2] = BLANK () )
)
_2yes =
VAR _count =
    CALCULATE (
        COUNT ( 'Table'[Field1] ),
        FILTER ( 'Table', 'Table'[Field2] > 2 && 'Table'[Attribute2] = "Yes" )
    )
RETURN
    IF ( 'Table'[Attribute2] = "Yes", _count, BLANK () )
blank_3 =
VAR count_ =
    CALCULATE (
        COUNT ( 'Table'[Field1] ),
        FILTER ( 'Table', 'Table'[Field2] > 2 && 'Table'[Attribute3] = BLANK () )
    )
RETURN
    IF ( 'Table'[Attribute3] = BLANK (), count_, BLANK () )
_3yes =
VAR _count =
    CALCULATE (
        COUNT ( 'Table'[Field1] ),
        FILTER ( 'Table', 'Table'[Field2] > 2 && 'Table'[Attribute3] = "Yes" )
    )
RETURN
    IF ( 'Table'[Attribute3] = "Yes", _count, BLANK () )

vpollymsft_1-1649315443084.png

 

If I have misunderstood your meaning, please provide your desired output and your pbix without privacy information.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

lbendlin
Super User
Super User

Please explain what you mean by "Count of Field1" - maybe COUNTROWS() ?

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
Top Kudoed Authors