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.
Hi, how to create 2 measures with the below criteria. Here is the sample.
Example: Product=P-1 is selected, the expected result is as below.
Type | Serial No Count | Job Count |
Escalation | 2 | 2 |
Install | 2 | 2 |
Repair | 1 | 1 |
Solved! Go to Solution.
@PBI_newuser , Try measure like
Switch(true()
max(Table[Type])="Install", calculate(count(Table[Job#]), All (Data[Product]), All (Data[Team])),
max(Table[Type])="Escalation", calculate(count(Table[Job#]), All (Data[Product]), All (Data[Team])),
max(Table[Type])="Repair", count(Table[Job#])
)
or
sumx(values(Table[Type]),
Switch(true()
max(Table[Type])="Install", calculate(count(Table[Job#]), All (Data[Product]), All (Data[Team])),
max(Table[Type])="Escalation", calculate(count(Table[Job#]), All (Data[Product]), All (Data[Team])),
max(Table[Type])="Repair", count(Table[Job#])
)
)
@PBI_newuser , you can use removefilters or all for product and Team
or
allexcept(Table, Table[Type], Table[Serial No])
example
calculate(count(Table[Job#]), filter(Table, [Escalation]= "Install"), all(Table[product]), all(Table[team]))
refer examples here
https://www.linkedin.com/pulse/five-recent-power-bi-functions-you-should-use-more-often-amit-chandak
https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/
Hi @amitchandak , how to combine below 3 if statement in measure to get the output?
@PBI_newuser , Try measure like
Switch(true()
max(Table[Type])="Install", calculate(count(Table[Job#]), All (Data[Product]), All (Data[Team])),
max(Table[Type])="Escalation", calculate(count(Table[Job#]), All (Data[Product]), All (Data[Team])),
max(Table[Type])="Repair", count(Table[Job#])
)
or
sumx(values(Table[Type]),
Switch(true()
max(Table[Type])="Install", calculate(count(Table[Job#]), All (Data[Product]), All (Data[Team])),
max(Table[Type])="Escalation", calculate(count(Table[Job#]), All (Data[Product]), All (Data[Team])),
max(Table[Type])="Repair", count(Table[Job#])
)
)
User | Count |
---|---|
121 | |
72 | |
71 | |
57 | |
50 |
User | Count |
---|---|
167 | |
83 | |
68 | |
66 | |
55 |