Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

average + filter which bases on date

Hello, everyone.

I'm a newcomer in PowerBI.

And i have a first unsolution trouble with PowerBI.

 

I have a some trouble with calculation average + filter with date.

I have a table A, which contains some info.

I have another table, which has calculation info from table A, and that table gets distinct info from columns table A

I'm using this DAG for creation table

DAX:

v_average_article_hist = DISTINCT(SELECTCOLUMNS(v_uniq_article_hist,"dep",v_uniq_article_hist[department],"subdep", v_uniq_article_hist[subdepartment]))
 
Than that table calculates other it's columns:
DAX:
1 = AVERAGEX(FILTER(v_uniq_article_hist,
v_uniq_article_hist[start_date] >= MIN(Dates[Date]) &&
v_uniq_article_hist[start_date] <= MAX(Dates[Date]) &&
v_uniq_article_hist[department] = v_average_article_hist[dep] &&
v_uniq_article_hist[subdepartment] = v_average_article_hist[subdep] &&
v_uniq_article_hist[step] = 1 &&
v_uniq_article_hist[works_days] < 1), v_uniq_article_hist[works_days])
...
 
And info in reports doesn't support changing date with slicer, but v_uniq_article_hist supports filtering with date.
But if i set the MIN(Dates[Date]) and MAX(Dates[Date]) ("01.01.2020", "01.12.2020"), it will be able to show info, which bases on date.
 
I don't know how to fix that trouble.
Please, help dear members from forum)

3 Replies