Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Creating a weighted graph using DAX / COUNT

Hello Power BI community,   I am a novice in Power BI DAX syntax writing and am desperate for assistance on a problem at work.   Here's the short of it: I have one table which has the RAW data be...
  • v-yulgu-msft's avatar
    7 years ago

    Hi Anonymous,

     

    Based on my understanding, WeightedTable contains fields: [Brand], [Item] and [Weighted Number], RawTable contains [Brand] and [Item].

     

    Please create measure as below:

    weighted value =
    CALCULATE (
        MAX ( 'Weighted Table'[Weighted Number] ),
        FILTER (
            ALL ( 'Weighted Table' ),
            'Weighted Table'[Brand] = SELECTEDVALUE ( 'Raw Table'[Brand] )
                && 'Weighted Table'[Item] = SELECTEDVALUE ( 'Raw Table'[Item] )
        )
    )
    
    count item = COUNT('Raw Table'[Item])/'Raw Table'[weighted value]

     

    Best regards,

    Yuliana Gu