Forum Discussion
Hello everyone, I need an help Regarding Power Query/Dax in Power BI
Hi Guys,
Morning!
I am working on Sales data and the data has Open Order Sales by Doc_date and Doc_due_date in the MCS_PowerBI_Fact table.
Requirement: I am looking for an Open Order Sales visual by Doc_due date. - Currently, I am getting open order sales by Doc_date
Measures I am using
The following measure was for currency conversion,
And By the following measure I am trying to get open order sales by DocDueDate - But, still, it was extracting by Doc date -
***I need a measure to get the open order sales by DocDueDate.*** and if possible, to include both OpenOrderSalesAUD and OpenOrderSalesLocal in a measure.
And, If I change the relationship to Doc_Date to Doc_Due_Date then the sales figures are effecting(Which was sales figures are getting wrong)
Any help can be appreciated
6 Replies
- AnonymousNot applicable
Try:
OpenOrderSales = CALCULATE(SUM([OpenOrderSalesAUD]), DISTINCT('MCS_POWERBI_FACT'[DocDueDate]), USERELATIONSHIP('Master Calendar'[Date]))
--Nate
- Sai_KumarFrequent Visitor
Hi Watkinnc,
Thanks for considering!
I tried the way as you said
The error follows-
Too few arguments were passed to the USERELATIONSHIP function. The minimum argument count for the function is 2.
- AnonymousNot applicable
Sorry--copy/paste error:
OpenOrderSales = CALCULATE(SUM([OpenOrderSalesAUD]), DISTINCT('MCS_POWERBI_FACT'[DocDueDate]), USERELATIONSHIP('MCS_POWERBI_FACT'[DocDueDate],'Master Calendar'[Date]))
- Sai_KumarFrequent Visitor
I tried it - But, the measure output was the same as my last measure as mentioned in the post.
- Sai_KumarFrequent Visitor
If you see the Doc_Date and Doc_Due_Date columns
The requirement was, we need to extract only Doc_Due_date if Doc_Due_date was in the Current month.The OLD_Open Order Sales measure was working but giving us all open order Sales - where we need only present and future months open order sales.