Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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#])
)
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
88 | |
77 | |
58 | |
43 | |
38 |
User | Count |
---|---|
116 | |
81 | |
81 | |
50 | |
39 |