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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors