Forum Discussion

PBI5851's avatar
PBI5851
Helper V
2 years ago
Solved

Measure using a measure or create a column

Hello team, 

My raw data is as below. 

RegionStateTMActiveCountInactiveCount
WestCATim510
WestAZMark85
WestCASteve65
WestCAMark55
WestCOJohn44
EastNJMary24
EastNJMick55
EastMDJack810

 

The end goal, is to create a "forecast/goal-ish" columns as below. And having the State as a slicer, the end table should be 

TMGoalActiveCountActive+1Active+2Active+3Total
Jack2589111240
John25455620
Mark251315171762
Mary25223310
Mick25567825
Steve25678930
Tim25567825
TOTAL 43495763212

 

The Goals is a straight measure. 

ActiveCount is a straight count from the raw table. 

Active+1 = If Activecount <15, then add 15% to ActiveCount else leave it as Active Count. 

Active+2 = If Active+1 < 15, then add 15% to Active+1 else leave it as Acitve+1

Active+3 = If Active +2 < 15 then add 15% to Active+2 else leave it as Acitve+2

 

Now the issues i am facing. 

- I can get the Active Count and Active+1 , but Active+2 measure wont let me use the Active+1 measure

- The summary/Total does not work as its a measure. 

- If i convert the Active+1 into a calcualted column , then Mark shows up in two rows when CA state selected in slicer. 

 

Any recommendations on how to get this please. 

  • PBI5851 try these measures:

     

    Sum Active = SUM ( TableActive[ActiveCount] )
    
    Active +1 = 
    VAR __Table = ADDCOLUMNS ( SUMMARIZE ( TableActive, TableActive[TM] ), "@ActiveCount", [Sum Active] )
    RETURN
        SUMX ( 
            __Table,
            IF ( [@ActiveCount] < 15, [@ActiveCount] * 1.15, [@ActiveCount] )
        )
    
    Active +2 = 
    VAR __Table = ADDCOLUMNS ( SUMMARIZE ( TableActive, TableActive[TM] ), "@ActiveCount", [Active +1] )
    RETURN
        SUMX ( 
            __Table,
            IF ( [@ActiveCount] < 15, [@ActiveCount] * 1.15, [@ActiveCount] )
        )
    
    Active +3 = 
    VAR __Table = ADDCOLUMNS ( SUMMARIZE ( TableActive, TableActive[TM] ), "@ActiveCount", [Active +2] )
    RETURN
        SUMX ( 
            __Table,
            IF ( [@ActiveCount] < 15, [@ActiveCount] * 1.15, [@ActiveCount] )
        )
    
    Total = [Sum Active] + [Active +1] + [Active +2] + [Active +3]

1 Reply

  • PBI5851 try these measures:

     

    Sum Active = SUM ( TableActive[ActiveCount] )
    
    Active +1 = 
    VAR __Table = ADDCOLUMNS ( SUMMARIZE ( TableActive, TableActive[TM] ), "@ActiveCount", [Sum Active] )
    RETURN
        SUMX ( 
            __Table,
            IF ( [@ActiveCount] < 15, [@ActiveCount] * 1.15, [@ActiveCount] )
        )
    
    Active +2 = 
    VAR __Table = ADDCOLUMNS ( SUMMARIZE ( TableActive, TableActive[TM] ), "@ActiveCount", [Active +1] )
    RETURN
        SUMX ( 
            __Table,
            IF ( [@ActiveCount] < 15, [@ActiveCount] * 1.15, [@ActiveCount] )
        )
    
    Active +3 = 
    VAR __Table = ADDCOLUMNS ( SUMMARIZE ( TableActive, TableActive[TM] ), "@ActiveCount", [Active +2] )
    RETURN
        SUMX ( 
            __Table,
            IF ( [@ActiveCount] < 15, [@ActiveCount] * 1.15, [@ActiveCount] )
        )
    
    Total = [Sum Active] + [Active +1] + [Active +2] + [Active +3]