Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello, I have a table visual with number of travel and non travel days per emplyee. The requirements is that each person is supposed to travel 301 days out of the year, so I am trying to make a measure that shows the difference. I need that number to sum to a total at the bottom, but it doesn't and I dont know how to apply SUMx or SUM in this example.
(Note: 'Labor Cost per Day'[Person Traveling) is a value of 1 or 0 in a calendar table. If person is traveling on that day, it's 1. If not, it's 0)
Measure:
Solved! Go to Solution.
Hi @Kinga99
Please try
Days Difference =
SUMX (
VALUES ( 'Labor Cost per Day'[Person] ),
CALCULATE (
VAR diff =
SUM ( 'Labor Cost per Day'[Person Traveling] )
RETURN
IF ( diff >= 301, 0, 301 - diff )
)
)
Hi @Kinga99
Please try
Days Difference =
SUMX (
VALUES ( 'Labor Cost per Day'[Person] ),
CALCULATE (
VAR diff =
SUM ( 'Labor Cost per Day'[Person Traveling] )
RETURN
IF ( diff >= 301, 0, 301 - diff )
)
)
Thank you, that worked like a charm!
User | Count |
---|---|
21 | |
19 | |
12 | |
9 | |
8 |
User | Count |
---|---|
30 | |
27 | |
14 | |
13 | |
10 |