Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I have a matrix like the one below and require 2 measures -
Firstly a measure that returns the latest value for each product, so in the example below this would return 63 for Ball, but 64 for Pear, even though both those values come from different months.
Secondly, a measure that returns the previous value for each product, so in the example below the previous value for Apple would be 85 and it would be 25 for Ball.
Any advise appreciated, thank you.
Solved! Go to Solution.
Hi @DW868990 ,
I have created a simple sample, please refer to my pbix file to see if it helps you.
Create 2 measures.
Measure1 =
VAR _1 =
MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[product] = SELECTEDVALUE ( 'Table'[product] )
),
'Table'[month-year]
)
RETURN
CALCULATE (
MAX ( 'Table'[value] ),
FILTER (
ALL ( 'Table' ),
'Table'[product] = SELECTEDVALUE ( 'Table'[product] )
&& 'Table'[month-year] = _1
)
)
Measure2 =
VAR _1 =
MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[product] = SELECTEDVALUE ( 'Table'[product] )
),
'Table'[month-year]
)
RETURN
CALCULATE (
MAX ( 'Table'[value] ),
FILTER (
ALL ( 'Table' ),
'Table'[product] = SELECTEDVALUE ( 'Table'[product] )
&& 'Table'[month-year] < _1
)
)
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Share the download link of the PBI file.
Hi @DW868990 ,
I have created a simple sample, please refer to my pbix file to see if it helps you.
Create 2 measures.
Measure1 =
VAR _1 =
MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[product] = SELECTEDVALUE ( 'Table'[product] )
),
'Table'[month-year]
)
RETURN
CALCULATE (
MAX ( 'Table'[value] ),
FILTER (
ALL ( 'Table' ),
'Table'[product] = SELECTEDVALUE ( 'Table'[product] )
&& 'Table'[month-year] = _1
)
)
Measure2 =
VAR _1 =
MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[product] = SELECTEDVALUE ( 'Table'[product] )
),
'Table'[month-year]
)
RETURN
CALCULATE (
MAX ( 'Table'[value] ),
FILTER (
ALL ( 'Table' ),
'Table'[product] = SELECTEDVALUE ( 'Table'[product] )
&& 'Table'[month-year] < _1
)
)
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |