The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Can I get kpi based on a column that is not a primary key?
for example
I selected 31-01-2019 and department 1, result is 80.0%
I want to show the kpi of the region through the ID_departamet.
I tried this, but do you add the KPIs (156.0%)
CALCULATE(
SUM(KPI[PORCENT]),
FILTER(
ALL(KPI),
KPI[LOCATION]=SELECTEDVALUE(LOCATION[REGION])
)
thank you....
Solved! Go to Solution.
Perhaps:
Measure =
VAR __deptID = SELECTEDVALUE('LOCATION'[ID_DEPARTMENT])
VAR __locID = LOOKUPVALUE('LOCATION'[ID_REGION],[ID_DEPARTMENT],__deptID)
VAR __date = SELECTEDVALUE('CALENDAR'[DATE])
RETURN
LOOKUPVALUE('KPI'[PORCENT],[ID_LOCATION],__locID,[DATE],__date)
Perhaps:
Measure =
VAR __deptID = SELECTEDVALUE('LOCATION'[ID_DEPARTMENT])
VAR __locID = LOOKUPVALUE('LOCATION'[ID_REGION],[ID_DEPARTMENT],__deptID)
VAR __date = SELECTEDVALUE('CALENDAR'[DATE])
RETURN
LOOKUPVALUE('KPI'[PORCENT],[ID_LOCATION],__locID,[DATE],__date)
Thank you very much my friend.
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
13 | |
10 | |
7 |