Forum Discussion
Create benchmark for specific categories
- 6 years ago
Give a try with this one
Region bench = VAR __company = VALUES ( Company[name] ) VAR __region = IF ( HASONEVALUE ( Company[name] ); CALCULATE ( SUM ( Company[dss_employee_count] ); FILTER ( ALL ( Company[name] ); Company[name] = __company ) ); BLANK () ) RETURN CALCULATE ( [Skadeskroner]; FILTER ( ALL ( Company ); Company[dss_employee_count] = __region ) )Regards,
Ruslan Zolotukhin (zoloturu)
BI Engineer at Akvelon Inc. / Kharkiv Power BI User Group Leader / DAX & Power BI Trainer
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!
It was useful? Press Thumbs Up!
You are from Ukraine? If yes then welcome to Power BI User Group - KhPUG website. Other country? Check and find proper one - Power BI User Groups
Hi rhl94 ,
SELECTEDVALUE function works fine in Power BI Desktop. So it should work for you too.
Regarding your measure, what is the error message at a visual?
Regards,
Ruslan Zolotukhin (zoloturu)
BI Engineer at Akvelon Inc. / Kharkiv Power BI User Group Leader / DAX & Power BI Trainer
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!
It was useful? Press Thumbs Up!
You are from Ukraine? If yes then welcome to Power BI User Group - KhPUG website. Other country? Check and find proper one - Power BI User Groups
- rhl946 years agoAdvocate III
Hi zoloturu
SELECTEDVALUE is not supported in our version of SSAS, as it was introduced after ;
"SELECTEDVALUE function was introduce to PowerBI in July 2017, after the release of SQL Server 2016. It can not be implemented on Microsoft SQL Server 2016 Analysis Services."
I have tried using
IF ( HASONEVALUE ( Table[column] ), VALUES ( Table[column] ) )
but it still evaluates and this returns an error;
It does seem to return blank however, when I remove "name" from the table:
- zoloturu6 years agoMemorable Member
Hi rhl94 ,
Try this one:
Region bench = VAR Region = IF ( HASONEVALUE ( Company[name] ); LOOKUPVALUE ( Company[dss_employee_count]; Company[name]; VALUES ( Company[name] ) ); "" ) RETURN CALCULATE ( [Skadeskroner]; ALL ( Company ); Company[dss_employee_count] = Region )Regards,
Ruslan Zolotukhin (zoloturu)
BI Engineer at Akvelon Inc. / Kharkiv Power BI User Group Leader / DAX & Power BI Trainer
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!
It was useful? Press Thumbs Up!
You are from Ukraine? If yes then welcome to Power BI User Group - KhPUG website. Other country? Check and find proper one - Power BI User Groups