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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

cross tab with more than fileds as rows section

Hi All,

 

I have a requirement to show data as cross tab with more than 1 rows in a table i have used matrix but its allowing me only one field.

 

req2 : i have values and respective status ,I wanted to display Y or N(if no status/blank) and count only Y in the total.

 

attached data sheets 

thanks in adavnce

Cross tab_0611_2.PNG

 

Please find attached Pbx file and sample data Cross tab_0611.PNG

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Anonymous ,

 

It is not possible to show a numeric count value in grand total row while display text values in detailed rows. As a workaround, we can display 1 to represent ACTIVE and 0 to represent INACTIVE/no STATUS,  then count only 1 in total row.

 

New a calculated table first. 

Data2 =
CROSSJOIN (
    CROSSJOIN (
        SUMMARIZE ( Data1, Data1[region], Data1[country], Data1[CTR] ),
        VALUES ( Data1[Type] )
    ),
    VALUES ( Data1[status] )
)

Add a calculated column in above table 'Data2'.

If Y/N =
VAR _checkStatus =
    CALCULATE (
        LASTNONBLANK ( Data1[status], 1 ),
        FILTER (
            Data1,
            Data1[region] = EARLIER ( Data2[region] )
                && Data1[country] = EARLIER ( Data2[country] )
                && Data1[CTR] = EARLIER ( Data2[CTR] )
                && Data1[Type] = EARLIER ( Data2[Type] )
                && Data1[status] = Data2[status]
        )
    )
VAR _checkSales =
    CALCULATE (
        LASTNONBLANK ( Data1[sale], 1 ),
        FILTER (
            Data1,
            Data1[region] = EARLIER ( Data2[region] )
                && Data1[country] = EARLIER ( Data2[country] )
                && Data1[CTR] = EARLIER ( Data2[CTR] )
                && Data1[Type] = EARLIER ( Data2[Type] )
                && Data1[status] = Data2[status]
        )
    )
RETURN
    IF ( _checkStatus <> BLANK () && _checkSales <> BLANK (), 1, 0 )

Use a Matrix to display data.

1.PNG2.PNG3.PNG

I have uploaded the sample .pbix file for your reference.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @Anonymous ,

 

It is not possible to show a numeric count value in grand total row while display text values in detailed rows. As a workaround, we can display 1 to represent ACTIVE and 0 to represent INACTIVE/no STATUS,  then count only 1 in total row.

 

New a calculated table first. 

Data2 =
CROSSJOIN (
    CROSSJOIN (
        SUMMARIZE ( Data1, Data1[region], Data1[country], Data1[CTR] ),
        VALUES ( Data1[Type] )
    ),
    VALUES ( Data1[status] )
)

Add a calculated column in above table 'Data2'.

If Y/N =
VAR _checkStatus =
    CALCULATE (
        LASTNONBLANK ( Data1[status], 1 ),
        FILTER (
            Data1,
            Data1[region] = EARLIER ( Data2[region] )
                && Data1[country] = EARLIER ( Data2[country] )
                && Data1[CTR] = EARLIER ( Data2[CTR] )
                && Data1[Type] = EARLIER ( Data2[Type] )
                && Data1[status] = Data2[status]
        )
    )
VAR _checkSales =
    CALCULATE (
        LASTNONBLANK ( Data1[sale], 1 ),
        FILTER (
            Data1,
            Data1[region] = EARLIER ( Data2[region] )
                && Data1[country] = EARLIER ( Data2[country] )
                && Data1[CTR] = EARLIER ( Data2[CTR] )
                && Data1[Type] = EARLIER ( Data2[Type] )
                && Data1[status] = Data2[status]
        )
    )
RETURN
    IF ( _checkStatus <> BLANK () && _checkSales <> BLANK (), 1, 0 )

Use a Matrix to display data.

1.PNG2.PNG3.PNG

I have uploaded the sample .pbix file for your reference.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.