March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
110 | |
75 | |
57 | |
52 | |
44 |
User | Count |
---|---|
157 | |
114 | |
63 | |
60 | |
50 |