Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi, I'm having issues creating a measure that can filter vaules in 2 separate columns. I'm looking to calculate kidnapping rate for each type of alert. My original calculation doesn't seem to take into account the type of alert.
I've attached some screenshots of the fields i'm looking to filter. (Type of Alert) and (Incidents with Crew Kidnapped)
Would be eternally grateful for any help.
Solved! Go to Solution.
[# Alerts] = COUNTROWS( T ) // T being your table
[Kidnapping Rate] =
DIVIDE(
CALCULATE(
[# Alerts],
KEEPFILTERS(
// Names of columns should be
// as short as possible but
// still meaningful.
T[Incidents with Crew Kidnapped] = "YES"
)
),
[# Alerts]
)
I warn you against having one-table models and not following the star schema. Watch this: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Why-one-table-models-will-produce-WRONG-NUMBE...
[# Alerts] = COUNTROWS( T ) // T being your table
[Kidnapping Rate] =
DIVIDE(
CALCULATE(
[# Alerts],
KEEPFILTERS(
// Names of columns should be
// as short as possible but
// still meaningful.
T[Incidents with Crew Kidnapped] = "YES"
)
),
[# Alerts]
)
I warn you against having one-table models and not following the star schema. Watch this: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Why-one-table-models-will-produce-WRONG-NUMBE...
Thanks for your solution, it is very much appreciated. I shall take a look at the video to improve things.
First of all, from what you've shown you simply can't caculate this. You have to be able to link the two tables somehow. Currently, as it stands, this model is useless for the type of caclulation you want do perform.
Are these two tables just one table?
Sorry i forgot to metion that this is all part of one table.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |