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

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

Reply
Anonymous
Not applicable

Help with DAX

Hi i'm trying to create a point calculation with this formula: 

1. Total Point = Distinct Count of Style#-Season * Base Point * Complexity
2. Complexity = 2 when Style Merch = B1 or O1, or when Model_Construction = S1 or S2 or S3, otherwise it's factor 1 ( no change)

3. If Marketing Type = P, add 3 points to Base Point, otherwise add 0 (no change)

I have a table like below:

Style#SeasonStyle#-SeasonFitLine Style_MerchModel_ConstructionMarketing TypeBase Point
ABC101Spring 23ABC101-Spring23Western R1B1S1P5
ABC102Summer 23ABC102-Summer23Asian R2O1S2not P4
ABC102Fall 23ABC102-Fall23GlobalR3Not B1 or O1S3not P3
ABC103Holiday 23ABC103-Holiday23PlusR4Not B1 or O1Not S1 or S2 or S3P2
ABC103Spring 23ABC103-Spring23WesternR5Not B1 or O1Not S1 or S2 or S3P1

 

11 REPLIES 11
Anonymous
Not applicable

create a measure for 

Complexity =
IF( MAX('Table'[Style_Merch]) IN {"B1","O1"},2,IF(MAX('Table'[Model_Construction]) IN {"S1","S2","S3"},2,1))

After That create a measure for Total Points
Total Point =
 var a =  DISTINCTCOUNT('Table'[Style#-Season])
 return a*MAX('Table'[Base Point])*[Complexity]
Anonymous
Not applicable

Thank you! Can you explain how do I add the criteria of Marketing Type into the measure as well?

3. If Marketing Type = P, add 3 points to Base Point, otherwise add 0 (no change)

Anonymous
Not applicable

@Anonymous use below measure for Total Point

Total Point =
 var a =  DISTINCTCOUNT('Table'[Style#-Season])
 var basePoint = MAX('Table'[Base Point])
 var addTbase = IF(MAX('Table'[Markeing Type])="P",3,0) + basePoint
 return a*addTbase*[Complexity]
Anonymous
Not applicable

Thank you for the quick response!

What if my basepoint column doesn't exist in real table and is supposed to be coming from all the possible combinations/permutations of the 2 attributes of Fit and Line ? Each should be assigned a unique value, how do i put that in the power pivot measures? 

e.g. 

 

FitLineBase Points (To be assigned in measure)
WesternR15
WesternR24
WesternR33
WesternR42
AsianR11
AsianR24
AsianR33
AsianR42
GlobalR16
GlobalR24
GlobalR33
GlobalR47
PlusR15
PlusR22
PlusR34
PlusR48

 

Anonymous
Not applicable

If your basepoint value is comming from measure then  in above measure replace 
 var basePoint = MAX('Table'[Base Point])

with 

 var basePoint =[Base Point] -- measure

Anonymous
Not applicable

I mean it should come from a measure but i have been having trouble trying to translate the table above into a measure using SWITCH or IF statement. Could you pls help? 

 

Ultimately, i would have to sum the total points up too so i can have a better overview. 

Anonymous
Not applicable

Can you explain what you are trying to achive so i can help 

Anonymous
Not applicable

How do i put this table into measure using SWITCH statement so that every single row with different "FIT" and "Line" combination can be assigned a "base point" based on what i input

 

 

 FitLineBase Points (To be assigned in measure)
WesternR15
WesternR24
WesternR33
WesternR42
AsianR11
AsianR24
AsianR33
AsianR42
GlobalR16
GlobalR24
GlobalR33
GlobalR47
PlusR15
PlusR22
PlusR34
PlusR48
ryan_mayu
Super User
Super User

@Anonymous 

below is the formula for the 2&3.  I am still not clear about the first one. could you pls provide elaberate on that? What's the output based on the sample data you provided?

 

_2 = if('Table'[Style_Merch] in {"B1","O1"}|| 'Table'[Model_Construction] in {"S1","S2","S3"},2,1)
_3 = if('Table'[Markeing Type]="P",3,0)
 
11.PNG

 





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

Proud to be a Super User!




Anonymous
Not applicable

Thank you! 

1 Should be the output whereby it computes the total point. 

 

The formula should be: distinct count of style#-season * base point (which should take into account #3) * complexity, i wish to have a measure that can sum this up. 


then use _2+ _3? is that what you wnat?





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

Proud to be a Super User!




Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Kudoed Authors