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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Subha
Frequent Visitor

MEASURES

I am new to PBI and seeking assistance. I have a huge dataset but created below a table to mimic what I am looking for.

 

DATA TABLE
CUSTOMERPO#VALUECATEGORY
A1 $    20.00P3
A2 $    40.00P3
A7 $  100.00P1
A10 $    50.00P2
B4 $  100.00P1
B3 $    50.00P2
B8 $    50.00P2
D5 $  200.00P1
D9 $  200.00P1
D6 $  100.00P1

Category is a calculated column.  I created the below measures to create the second matrix below.

 

M1= COUNT('DATA'[PO#])
M2 = CALCULATE([M1],ALL('DATA'[CATEGORY])
M3 =DIVIDE([M1],[M2],0)

I am struggling to write  a measure to get me the results highlighted in red below. If excel I would have used the formula IF(D18>=50%,"T1",IF(D18+E18>=50%,"T2","T3"))

MATRIX VISUAL 
CUSTOMERP1(cellD17)P2(CellE17)P3(Cell F17)CLASSIFICATION
A25%25%50%T2
B33%67% T2
D100%  T1

 

Any assistance would be greatly appreciated.

Thank you

 

1 ACCEPTED SOLUTION

@Subha , Based on what I got, a New measure like

 

measure =
var _m1 = calculate([M3], filter(all(Table[CATEGORY]), Table[CATEGORY] ="M1"))
var _m2 = calculate([M3], filter(all(Table[CATEGORY]), Table[CATEGORY] ="M2"))
var _m3 = calculate([M3], filter(all(Table[CATEGORY]), Table[CATEGORY] ="M3"))
return
IF(_m1>= .5,"T1",
IF(_m2+_m3>=.5,"T2","T3"))

View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

@Subha 

What's the logic of that formula?





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

Proud to be a Super User!




If the % of orders under category P1 is greater than 50% then classify as T1 if not add the percent of P1 and P2 and if that is greater than 50% classify as T2 else t3.  So the broad idea is to classify the orders by the $ value and then see what is teh % of orders by customer that fall under that range and then classify

 

Subha
Frequent Visitor

Amit - Refers to the specific excel cell 

@Subha , Based on what I got, a New measure like

 

measure =
var _m1 = calculate([M3], filter(all(Table[CATEGORY]), Table[CATEGORY] ="M1"))
var _m2 = calculate([M3], filter(all(Table[CATEGORY]), Table[CATEGORY] ="M2"))
var _m3 = calculate([M3], filter(all(Table[CATEGORY]), Table[CATEGORY] ="M3"))
return
IF(_m1>= .5,"T1",
IF(_m2+_m3>=.5,"T2","T3"))

amitchandak
Super User
Super User

@Subha , what are D18 and E18 here?

 

IF(D18>=50%,"T1",IF(D18+E18>=50%,"T2","T3"))

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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