Forum Discussion
Turn off dimension rows
- 5 years ago
Hi, xhurit
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Store:
Fact:
Calendar(a calculated table):
Calendar = CALENDARAUTO()Relationships:
You may create meausres like below.
Number of active store = var tab = CALCULATETABLE( DISTINCT(Store[Store]), FILTER( ALL(Store), NOT( OR( [Date_Open]>MAX('Calendar'[Date]), [Date_Close]<MIN('Calendar'[Date]) ) ) ) ) return COUNTROWS( tab )Visual Control = var startdate = SELECTEDVALUE(Store[Date_Open]) var enddate = SELECTEDVALUE(Store[Date_Close]) var mindate = MIN('Calendar'[Date]) var maxdate = MAX('Calendar'[Date]) return IF( NOT( OR( enddate<mindate, startdate>maxdate ) ), 1,0 )Avg = AVERAGE('Fact'[Sales])Then you may put 'Visual Control' in the visual level filter and use 'Date' column from 'Calendar' table to filter the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, xhurit
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Store:
Fact:
Calendar(a calculated table):
Calendar = CALENDARAUTO()
Relationships:
You may create meausres like below.
Number of active store =
var tab =
CALCULATETABLE(
DISTINCT(Store[Store]),
FILTER(
ALL(Store),
NOT(
OR(
[Date_Open]>MAX('Calendar'[Date]),
[Date_Close]<MIN('Calendar'[Date])
)
)
)
)
return
COUNTROWS(
tab
)
Visual Control =
var startdate = SELECTEDVALUE(Store[Date_Open])
var enddate = SELECTEDVALUE(Store[Date_Close])
var mindate = MIN('Calendar'[Date])
var maxdate = MAX('Calendar'[Date])
return
IF(
NOT(
OR(
enddate<mindate,
startdate>maxdate
)
),
1,0
)
Avg = AVERAGE('Fact'[Sales])
Then you may put 'Visual Control' in the visual level filter and use 'Date' column from 'Calendar' table to filter the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.