Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Converting measure values in column header in matrix

I have a measure that returns me values like Super, Flop, and Average. I want to use these values as a column name in a matrix and distribute my distinct count of products within these headings e:g

 

My Table

MeasureTotal Sales
Super12000
Super15000
Flop1000
Average9000


I have calulated that super , flop based on some conditions if my sales >=12000 then it is super , if sales<6000 then flop, and if sales<10000 and sales>6000 then average.Now my expected out put is

ProductsSuperFlopAverage

Soap

9966100
TV1006655
apple12112100
Mobile30020200
Watch40050100


Please help if you have any solutions for this.
Thanks In Advance!
amitchandak  Ahmedx Ritaf1983 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, Anonymous 

    Based on the information you have provided, Here are my answers to your questions.

     

    1. You need to create a table.

     

     

    1. You can create a Colum:

    Column = IF('Table'[Sales] >= 12000, "Super",

    IF('Table'[Sales]<6000,"Flop",

    IF('Table'[Sales]> 6000 &&'Table'[Sales]<12000,"Average")

    )

    )

     

     

    1. You can create another column for counting:

    Count =

    CALCULATE (

        COUNT ( 'Table'[Products] ),

        FILTER (

            'Table',

            'Table'[Products]= EARLIER('Table'[Products])&&'Table'[Column] = EARLIER('Table'[Column])

        )

    )

     

    1. Finally you will see the image shown below.

     

     

     

    How to Get Your Question Answered Quickly 

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Yilong Zhou

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

2 Replies

  • Anonymous 

    You cannot use meaures as row or column headers in visuals. The appraoch you can take is either create a disconnected table with these values Super, Flop, and Average and keep it on the column section of the visual then create a measure to identify the value and calculate your sales amount. The other way is to use Calculation group.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, Anonymous 

    Based on the information you have provided, Here are my answers to your questions.

     

    1. You need to create a table.

     

     

    1. You can create a Colum:

    Column = IF('Table'[Sales] >= 12000, "Super",

    IF('Table'[Sales]<6000,"Flop",

    IF('Table'[Sales]> 6000 &&'Table'[Sales]<12000,"Average")

    )

    )

     

     

    1. You can create another column for counting:

    Count =

    CALCULATE (

        COUNT ( 'Table'[Products] ),

        FILTER (

            'Table',

            'Table'[Products]= EARLIER('Table'[Products])&&'Table'[Column] = EARLIER('Table'[Column])

        )

    )

     

    1. Finally you will see the image shown below.

     

     

     

    How to Get Your Question Answered Quickly 

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Yilong Zhou

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