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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KrColeman
New Member

How do I take the output of a measure and use it in another equation and conditional formatting???

KrColeman_0-1686346372066.png

 

I used a measure to calculate Average Cost of airline tickets for the month of May for a section of our employees. I really would like to take the total $753.53 and show it in the table just as a constant number in a column, then calculate the variance (through quick measure average cost per employee minus average cost overall (ex: $543.33 - $753.53) to show employee 10102 is below average in his airfare purchase. Once I have the variance column, I'd like to conditional format based on the total average ($753.53), I could type that number into the conditional formatting but I'd rather use the measure so that when I add months and the total average for each month is different, I don't have to keep changing my conditional formatting manually. I can not find a video on how to use the output of my measure as a total and/or how to use the calculated output as highlight any value greater than 'Average Cost' measure.  My Measure below I created to get the average cost for airfare only (needed to filter down my Expense Type). Can someone please help!!! Thank you for the help in advance! 

Average Airfare =
CALCULATE(
    AVERAGE('May 2023'[Expense Amount]),
    'May 2023'[Expense Type] IN { "Airfare" }
)
 
1 ACCEPTED SOLUTION
some_bih
Super User
Super User

Hi @KrColeman 

I called column Variance as difference of current row value and overall average 753,5 (I inserted dummy data to get average as you do). Please note that you use your average measure, mine is just example.
For conditional formatting for column varince check last picture below. I hope this help.

 

Variance =
VAR _currentrow=[Average cost dummy  data]
VAR _average=[M_avg] -- with dummy data average is 753,5
Return
_currentrow -
CALCULATE(
    [M_avg],
    ALL(Sheet1)
)

some_bih_0-1686604505150.png

 

some_bih_1-1686604739043.png

 

 





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

Proud to be a Super User!






View solution in original post

3 REPLIES 3
some_bih
Super User
Super User

Hi @KrColeman 

I called column Variance as difference of current row value and overall average 753,5 (I inserted dummy data to get average as you do). Please note that you use your average measure, mine is just example.
For conditional formatting for column varince check last picture below. I hope this help.

 

Variance =
VAR _currentrow=[Average cost dummy  data]
VAR _average=[M_avg] -- with dummy data average is 753,5
Return
_currentrow -
CALCULATE(
    [M_avg],
    ALL(Sheet1)
)

some_bih_0-1686604505150.png

 

some_bih_1-1686604739043.png

 

 





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

Proud to be a Super User!






some_bih
Super User
Super User

HI @KrColeman few questions 🙂 :

--level of your data granularity: daily or monthly or...

--share you average measure definition

- in table / visaul there are only one Expense type (like Airfare) or other

- you want simple average per expense type FOR Employee and Month to be compared with overall average (everything) or ...





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

Proud to be a Super User!






Hi @some_bih,!

Thank you for trying to assist. Yes my DAX broke it down to only airfare for the expense type which is what I want. It is monthly by employee. So in the table my output is average per employee then at the bottom is the total $753. I want to know how I use the total $753 to find the difference per employees average- this issue is the $753 total comes from a measure so the measure keeps applying to the employee, I want to get the total for all the employees separate and keep separate to find the variance. Additionally I want to use as conditional formatting if possible, so any employee average greater than $753, their average cost I would highlight red. Thanks again for the help! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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