Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello All,
I need to create a dataset in Power Builder :.
I have two fact tables (Fact_Monthly et Fact_Weekly)
I have a parameter (@Period) with values (Monthly, Weekly)
I want to execute the SUMMERIZCOLUMNS based on user seletion
If user entered ="Monthly" =>get columns from Fact_Monthly
If user entered ="Weekly" =>get columns from Fact_Weekly
Here's my code
DEFINE
VAR __DS0FilterTable1 =
TREATAS({@Period}, 'Calender'[Période])
EVALUATE
IF(@Period="Monthly",//i also tried IF(__DS0FilterTable1="Monthly",
SUMMARIZECOLUMNS(
'Group'[Code Group],
'Fact_Monthly'[FolderNumber],
__DS0FilterTable1
)
,SUMMARIZECOLUMNS(
'Group'[Code Group],
'Fact_Weekly'[FolderNumber],
__DS0FilterTable1,
)
)
But the __DS0FilterTable1 return a table not a unique value! So i can't compare it with a text in my IF statment !
And i get the error : The expression refers to multiple columns... cannot be converted to a scalar value
Some help on how can i get the entered value ("Montly" or "Weekly") in the my parameter please !!
Thanks @some_bih !
I tried with query builder, it's always the same problem : getting a table result instead of unique text value !
the question is how can get the value (1) to compare it with the string (2) (monthly or weekly in english) ?
PS : the DAX of the measure SELECTEDITEM in my Power BI report is :
IF(HASONEVALUE('Calendar'[Période]),VALUES('Calendar'[Période]),BLANK())
//get selected period (Monthly or Weekly)
Hi @Abh_90 "I have two fact tables", in DAX Studio, tables should be connected "properly" to leverage feature DAX builder (or any other functions/tool...). I do not details about your model.
Proud to be a Super User!
Hi @Abh_90 I recognize you use DAX Studio.
In DAX Studio, there is query builder to help with your case, check link
https://daxstudio.org/docs/features/query-builder/
Proud to be a Super User!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
21 | |
20 | |
19 | |
13 | |
12 |
User | Count |
---|---|
41 | |
29 | |
23 | |
22 | |
22 |