Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a simple measure that is as follows:
What I need to accomplish is to make this measure conditional, based on the site:
If the Site equals 21201, then the formula should be:
AVG QTY PRODUCED = COUNT('SHIPMENTS OUT'[ORDER_NO])/SUM('CALENDAR'[DAYS WORKED 4 DAY])
Otherwise, it should be:
AVG QTY PRODUCED = COUNT('SHIPMENTS OUT'[ORDER_NO])/SUM('CALENDAR'[DAYS WORKED 5 DAY])
There is a need to look at the information as a whole, and separately, so I don't think separate measures will work.
Link to project mockup:
https://1drv.ms/u/s!Ar8mMAEgH9mzaiaJKQo9b7ZOR1I
This has been keeping me up at night. Any help is appreciated.
Solved! Go to Solution.
@Anonymous ,
Have you tried hard code on it?
AVG QTY PRODUCED =
VAR _site = SELECTEDVALUE(TABLE[SITE])
RETURN
IF _site = 21201;
COUNT('SHIPMENTS OUT'[ORDER_NO])/SUM('CALENDAR'[DAYS WORKED 4 DAY]);
AVG QTY PRODUCED = COUNT('SHIPMENTS OUT'[ORDER_NO])/SUM('CALENDAR'[DAYS WORKED 5 DAY]))
Did I answer your question? Mark my post as a solution!
Ricardo
That's a good idea. This is what worked.
@Anonymous ,
Have you tried hard code on it?
AVG QTY PRODUCED =
VAR _site = SELECTEDVALUE(TABLE[SITE])
RETURN
IF _site = 21201;
COUNT('SHIPMENTS OUT'[ORDER_NO])/SUM('CALENDAR'[DAYS WORKED 4 DAY]);
AVG QTY PRODUCED = COUNT('SHIPMENTS OUT'[ORDER_NO])/SUM('CALENDAR'[DAYS WORKED 5 DAY]))
Did I answer your question? Mark my post as a solution!
Ricardo
That's a good idea. This is what worked.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
8 |