The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello Community!
I'd like to put an X-Axis Constant line on a Scatter Chart for the 10th largest Entity and I've created 3 measures:
Total Entities =
CALCULATE(
COUNT('tbl'[NER_PII_Values])
)
Total Entities Ranking =
RANKX(
ALL('tbl'[NER_PII_Values]),
[Total Entities],
,DESC
)
Entity Distribution X Constant =
VAR TotalEntityRanking = [Total Entities Ranking]
RETURN
CALCULATE(
[Total Entities],
FILTER(
'tbl',
TotalEntityRanking = 10
)
)
On the Matrix, it looks great but when I use the measure in conditional formatting it shows as 0:
I'm expecting a line at 71,656.
Thank you in advance!
Solved! Go to Solution.
hi @Arete
tried to simulate your issue and find the solution with such sample data:
create a measure:
Value10th =
VAR _table =
ADDCOLUMNS(
TableName,
"Rank",
RANKX(
TableName,
TableName[Value1],
,
ASC
)
)
RETURN
MINX(
FILTER(_table, [Rank] = 10),
TableName[Value1]
)
it worked like this:
hi @Arete
tried to simulate your issue and find the solution with such sample data:
create a measure:
Value10th =
VAR _table =
ADDCOLUMNS(
TableName,
"Rank",
RANKX(
TableName,
TableName[Value1],
,
ASC
)
)
RETURN
MINX(
FILTER(_table, [Rank] = 10),
TableName[Value1]
)
it worked like this:
Hi, @FreemanZ thanks for the reply. Unfortunately, it's still not working. Is it because I'm using a measure in the RANKX?
Entity Distribution X-Axis line =
VAR tblRank =
ADDCOLUMNS(
'Top 250 Entities',
"Rank",
RANKX(
'Top 250 Entities',
[Total Entities],
,
DESC
)
)
RETURN
MINX(
FILTER(tblRank, [Rank] = 10),
[Total Entities]
)
The Total Entities measure is just a count:
Total Entities =
CALCULATE(
COUNT('Top 250 Entities'[NER_PII_Values])
)
Your suggestion comes back with Blank when it should be 71.624:
It depends. It might be on different granularities. Try to replace the measure with a column reference: 'Top 250 Entities'[NER_PII_Values]