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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Measure Column By Category

Hello guys,

 

Can you help me with this one?

 

I have a table as shown below:

Capture.PNG

 

so basically, what I want to make is a new measurement like the configuration column on the above image.

thank you

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.

Table:

c1.png

 

You may create measures as follows.

 

Configuration % = 
DIVIDE(
    SUM('Table'[Total Unit]),
    CALCULATE(
        SUM('Table'[Total Unit]),
        FILTER(
            ALLSELECTED('Table'),
            'Table'[Year] = MAX('Table'[Year])
        )
    )
) 

Take up = 
DIVIDE(
    SUM('Table'[Sold]),
    SUM('Table'[Total Unit])
)

Remaining = 
SUM('Table'[Total Unit]) - SUM('Table'[Sold])

Configuration of Remaining Unit % = 

    DIVIDE(
      [Remaining],
      CALCULATE(
          [Remaining],
          FILTER(
              ALLSELECTED('Table'),
              'Table'[Year] = MAX('Table'[Year])
          )
      )
    )

 

 

Result:

c2.png

 

Best Regards

Allan

 

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

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.

Table:

c1.png

 

You may create measures as follows.

 

Configuration % = 
DIVIDE(
    SUM('Table'[Total Unit]),
    CALCULATE(
        SUM('Table'[Total Unit]),
        FILTER(
            ALLSELECTED('Table'),
            'Table'[Year] = MAX('Table'[Year])
        )
    )
) 

Take up = 
DIVIDE(
    SUM('Table'[Sold]),
    SUM('Table'[Total Unit])
)

Remaining = 
SUM('Table'[Total Unit]) - SUM('Table'[Sold])

Configuration of Remaining Unit % = 

    DIVIDE(
      [Remaining],
      CALCULATE(
          [Remaining],
          FILTER(
              ALLSELECTED('Table'),
              'Table'[Year] = MAX('Table'[Year])
          )
      )
    )

 

 

Result:

c2.png

 

Best Regards

Allan

 

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

Anonymous
Not applicable

It works!

Thank you for your help.

 

Sorry if my questions aren't that clear.

 

 

Razwan
Helper I
Helper I

@Anonymous 
Hi, since you need the (%) by year, you may use these measures:

# Total Units = SUM ('YourTable'[Total Unit])
# Total Units Per Year = 
    CALCULATE(
        [# Total Units],
            ALLEXCEPT( 'YourTable',
                'YourTable'[Year],
                'YourTable'[Cluster],
                'YourTable'[Sub Cluster]
            )
    )
# Configuration (%) = DIVIDE( [# Total Units], [# Total Units Per Year], 0 )

 
Kind regards,
Razwan

amitchandak
Super User
Super User

Try

configuration % = divide(sum(table[Total Units]),calculate(sum(table[Total Units]),all(table)))
Remaning = sum(table[Total Units]) -sum(table[sold])	
configuration % = divide(sum(table[Total Units]),calculate(sum(table[Total Units]),all(table)))
take up =divide(sum(table[sold]),sum(table[Total Units]))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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