Forum Discussion
powerbilover123
2 years agoRegular Visitor
Getting value from another table (timeperiod)
I have a measure that takes every unique timeperiod value from a dimension-table and then calculates what value falls in that timeperiod in the fact-table and counts them. I want to create a g...
- Anonymous2 years ago
For your question, here is the method I provided:
Here's some dummy data
"dim"
"fact"
Create a measure. Counts the values in the fact table for that time period.
count num = var _dimtime = SELECTEDVALUE('dim'[Time]) var _facttime = SELECTEDVALUE('fact'[Time]) RETURN IF( _dimtime = _facttime, CALCULATE(COUNTROWS('fact'), FILTER('fact', 'fact'[Time] = MAX('fact'[Time]))), 0 )Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
2 years agoNot applicable
For your question, here is the method I provided:
Here's some dummy data
"dim"
"fact"
Create a measure. Counts the values in the fact table for that time period.
count num =
var _dimtime = SELECTEDVALUE('dim'[Time])
var _facttime = SELECTEDVALUE('fact'[Time])
RETURN
IF(
_dimtime = _facttime,
CALCULATE(COUNTROWS('fact'), FILTER('fact', 'fact'[Time] = MAX('fact'[Time]))),
0
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.