Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I want to use the Calculate with Selected value to return just one value, according to filters.
But my code doesn't work.
Below there is the DAX code and the data model
The result should be 01/08/2022, but instead, it returns BLANK.
Solved! Go to Solution.
Hi,
I am not sure how your datamodel looks like, but please try below whether it suits your requirement.
TEST measure: =
VAR _minvalor =
MINX (
FILTER (
ALLSELECTED ( 'DATABASE' ),
'DATABASE'[Data] >= DATE ( 2022, 1, 1 )
&& 'DATABASE'[Data] <= DATE ( 2022, 11, 1 )
&& 'DATABASE'[Tipo] = "REALIZADO/TOTAL"
),
'DATABASE'[Valor]
)
RETURN
MINX (
FILTER (
ALLSELECTED ( 'DATABASE' ),
'DATABASE'[Data] >= DATE ( 2022, 1, 1 )
&& 'DATABASE'[Data] <= DATE ( 2022, 11, 1 )
&& 'DATABASE'[Tipo] = "REALIZADO/TOTAL"
&& 'DATABASE'[Valor] = _minvalor
),
'DATABASE'[Data]
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
I am not sure how your datamodel looks like, but please try below whether it suits your requirement.
TEST measure: =
VAR _minvalor =
MINX (
FILTER (
ALLSELECTED ( 'DATABASE' ),
'DATABASE'[Data] >= DATE ( 2022, 1, 1 )
&& 'DATABASE'[Data] <= DATE ( 2022, 11, 1 )
&& 'DATABASE'[Tipo] = "REALIZADO/TOTAL"
),
'DATABASE'[Valor]
)
RETURN
MINX (
FILTER (
ALLSELECTED ( 'DATABASE' ),
'DATABASE'[Data] >= DATE ( 2022, 1, 1 )
&& 'DATABASE'[Data] <= DATE ( 2022, 11, 1 )
&& 'DATABASE'[Tipo] = "REALIZADO/TOTAL"
&& 'DATABASE'[Valor] = _minvalor
),
'DATABASE'[Data]
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |