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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
apatwal
Helper III
Helper III

Help in Creating a calculated Column or Measure

Hi,

 

I am new to Power Bi and need help in creating measure to include status column which includes Decrease if Revenue 2020 > Revenue 2021 else Increase for each combination of customer and product.

 

I have below table

apatwal_3-1644250609240.png

 

Requires below output

apatwal_2-1644250422400.png

Irrespective of date and location, sum the value of Revenue 2021 and Revenue 2020 and then create a column to include Decrease or Increase based on these values.

 

Any help or guidance will be appreciated.

 

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @apatwal ,

 

You can create a measure with below code:-

Status =
IF (
    SUM ( 'Table (3)'[revenue 2021] ) < SUM ( 'Table (3)'[revenue 2020] ),
    "Decrease",
    "Increase"
)

 

Output:-

Samarth_18_1-1644256271762.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Please Try This Measure 

Status = 
VAR _R2020 = SELECTEDVALUE('Table'[Revenue 2020])
VAR _R2021 = SELECTEDVALUE('Table'[Revenue 2021])
VAR RESULT  = SWITCH(TRUE(),_R2020>_R2021,"Decrease","Increase")
return RESULT 

 

Samarth_18
Community Champion
Community Champion

Hi @apatwal ,

 

You can create a measure with below code:-

Status =
IF (
    SUM ( 'Table (3)'[revenue 2021] ) < SUM ( 'Table (3)'[revenue 2020] ),
    "Decrease",
    "Increase"
)

 

Output:-

Samarth_18_1-1644256271762.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors