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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
gauravnarchal
Post Prodigy
Post Prodigy

Points Calculation using Measure

Hello

 

I need your help to create a measure as

 

  • Count “item” from table InvoiceDetails and multiply each item with the points below and show the result in matrix visual.
    • If Hand Made Multiply by 3
    • If Machine Multiply by 5

Result - Matrix Visual 

 

InvoiceNumberHand MadeMachineTotal
831257 55
8312593 3
831261 55
8312643 3
8312653 3
831265 55
Grand Total91524

 

 

Table:- Category

 

InvoiceIDInvoiceDetailIDCategory
9424972534258Machine
9424982534260Hand Made
9424992534268Machine
9425002534270Machine
9425012534272Hand Made
9425022534274Hand Made
9425022539274Machine

 

Table:- InvoiceNumber

 

InvoiceIDInvoiceDetailIDInvoiceDateInvoiceNumber
942497253425811/1/2021 0:00831257
942498253426011/1/2021 0:00831259
942499253426811/1/2021 0:00831260
942500253427011/1/2021 0:00831261
942501253427211/1/2021 0:00831264
942502253427411/1/2021 0:00831265
942502253927411/1/2021 0:00831265

 

Table:- InvoiceDetails

 

InvoiceIDInvoiceDetailIDItem
9424972534258UBY4SL
9424982534260URH/NOV/051121
9424992534268 
94250025342709876865790
94250125342729876865790/91
94250225342749876865789
94250225392749876865689
1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@gauravnarchal,

 

Try this solution.

 

Data model:

 

The relationships defaulted to one-to-one based on your example data.

 

DataInsights_0-1638975976597.png

 

Measures:

 

Item Count = COUNT ( InvoiceDetails[Item] )
Category Count = 
SUMX (
    InvoiceNumber,
    VAR vCategory =
        RELATED ( Category[Category] )
    VAR vFactor =
        IF ( vCategory = "Hand Made", 3, 5 )
    RETURN
        [Item Count] * vFactor
)

 

Be sure that InvoiceDetails[Item] contains BLANK (null) and not empty strings.

 

Result:

 

DataInsights_1-1638976096273.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
DataInsights
Super User
Super User

@gauravnarchal,

 

Try this solution.

 

Data model:

 

The relationships defaulted to one-to-one based on your example data.

 

DataInsights_0-1638975976597.png

 

Measures:

 

Item Count = COUNT ( InvoiceDetails[Item] )
Category Count = 
SUMX (
    InvoiceNumber,
    VAR vCategory =
        RELATED ( Category[Category] )
    VAR vFactor =
        IF ( vCategory = "Hand Made", 3, 5 )
    RETURN
        [Item Count] * vFactor
)

 

Be sure that InvoiceDetails[Item] contains BLANK (null) and not empty strings.

 

Result:

 

DataInsights_1-1638976096273.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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