Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I create a table called KPI BY YEAR , with two columns YEAR and Num KPI , this table has a relationship with just Date table .
Year Num KPI
2020 10
2021 12
I have also a slicer on a month using a date column of table Date, i am trying just to find the NUM KPI using dax formula but it doesn't function.
This is my dax forumula :
NumPKIYEAR = VALUES ('KPI BY YEAR'[Num KPI])
Solved! Go to Solution.
Hi, @OmarSek
The ‘VALUES ’ function is not normally used to return a single value. It returns a one-column table that contains the distinct values from the specified column. So it should be applied to the creation of table(such as calculated tables or temporary tables in measure)
Please try code like below to find the NUM KPI :
NumPKIYEAR =
CALCULATE (
MAX ( 'KPI BY YEAR'[Num KPI] ),
FILTER (
ALL ( 'KPI BY YEAR' ),
'KPI BY YEAR'[Year] = SELECTEDVALUE ( 'Date'[Year] )
&& 'KPI BY YEAR'[Month] = SELECTEDVALUE ( 'Date'[Month] )
)
)
Best Regards,
Community Support Team _ Eason
Hi, @OmarSek
The ‘VALUES ’ function is not normally used to return a single value. It returns a one-column table that contains the distinct values from the specified column. So it should be applied to the creation of table(such as calculated tables or temporary tables in measure)
Please try code like below to find the NUM KPI :
NumPKIYEAR =
CALCULATE (
MAX ( 'KPI BY YEAR'[Num KPI] ),
FILTER (
ALL ( 'KPI BY YEAR' ),
'KPI BY YEAR'[Year] = SELECTEDVALUE ( 'Date'[Year] )
&& 'KPI BY YEAR'[Month] = SELECTEDVALUE ( 'Date'[Month] )
)
)
Best Regards,
Community Support Team _ Eason
@OmarSek , a calculated table will not take slicer value.
Join with a join table, have year, month, Qtr column in the table and use that to plot year wise data in visual
@amitchandak i understand the reason , but the can you explain more the solution. Thanks
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
70 | |
37 | |
29 | |
26 |
User | Count |
---|---|
91 | |
49 | |
45 | |
38 | |
37 |