Forum Discussion
Measure Does Not Return Result Sometimes
Hi all,
Using Power BI Desktop July, 2021.
My measure does not return a result in some cases, but other times it returns the expected result. In the measure below, I can see that both dates exist in the referenced tables
SELECTEDVALUE will return the value if there is only one distinct selected value in the column.
Most likely your measure is not working when you have more than one value or when there is no corresponding date in Table1 or Table2 in your filter context.
4 Replies
- ryan_mayuSuper User
Anonymous
could you pls provide the sample data and expected output?
- Mohammad_RefaeiSolution Specialist
SELECTEDVALUE will return the value if there is only one distinct selected value in the column.
Most likely your measure is not working when you have more than one value or when there is no corresponding date in Table1 or Table2 in your filter context.
- AnonymousNot applicable
Thanks m_refaei,
It also seems I cannot use DateDiff as a meausre directly on a date file in a table.
For example this does not seem to work as a measure, but it does work as a calculated column
Total Days = DATEDIFF(Dates[Begin_Date],Dated(End_Date],DAY)
What other function should I wrap each date in to get this work as a Measure?
Thanks,
-w
- AnonymousNot applicable
Hi Anonymous ,
1. Are you select the two tables in the slice values when only a table of selected values, which led to the equation has only one value can not be calculated.
2. Check that the results in the data view are correct. If you have multiple duplicate rows, when you add the fields to the table visual, they may aggregate and return larger values or not.
Can you share sample data and sample output in table format? Or a sample pbix after removing. sensitive data.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly