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.
Hi
I am looking to find a formula, to calculate a measure.
Scenario
Ask
how to calculate a measure to That I can use in "Card" visual, to show case number of Licensee with more than 20 advisers only.
Solved! Go to Solution.
Hi,
I am not sure without seeing your data model, however, I tried to create a sample pbix file like below.
Please check the attached file and the below measure.
Licensee count (more than 20 advisers only) measure: =
VAR _newtable =
ADDCOLUMNS (
VALUES ( Data[Licensee] ),
"@countadvisers", CALCULATE ( COUNTROWS ( VALUES ( Data[Advisers] ) ) )
)
VAR _filternewtable =
FILTER ( _newtable, [@countadvisers] > 20 )
RETURN
COUNTROWS ( _filternewtable )
Hi,
I am not sure without seeing your data model, however, I tried to create a sample pbix file like below.
Please check the attached file and the below measure.
Licensee count (more than 20 advisers only) measure: =
VAR _newtable =
ADDCOLUMNS (
VALUES ( Data[Licensee] ),
"@countadvisers", CALCULATE ( COUNTROWS ( VALUES ( Data[Advisers] ) ) )
)
VAR _filternewtable =
FILTER ( _newtable, [@countadvisers] > 20 )
RETURN
COUNTROWS ( _filternewtable )
Thanks mate, it worked. How do I mark this as a solution?
Hi @Anonymous
a small sample data would be greatly useful to support with accurate code.
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
33 | |
13 | |
12 | |
9 | |
7 |