Forum Discussion
Regarding hash one value dax function
- 1 year ago
Hi Bharathpowerbi ,
The reason your hashonevalue measure isn't returning a result when filtering by Country is because of how HASONEVALUE(financials[Segment]) works. Your formula:
hashonevalue = IF(HASONEVALUE(financials[Segment]), SUM(financials[Profit]), BLANK())only returns the profit if exactly one segment is selected. When you select France in the Country slicer, it may still include multiple segments in the data, so HASONEVALUE returns false, and the measure shows blank. This is expected behavior, not a cross-filtering issue.
To confirm how many segments are active under the current filters, you can add:
Selected Segment Count = DISTINCTCOUNT(financials[Segment])If this count is greater than one, your original measure will remain blank. The measure is working as designed, but the result depends entirely on the data context created by your slicers.
Best regards,
Hi Bharathpowerbi ,
The reason your hashonevalue measure isn't returning a result when filtering by Country is because of how HASONEVALUE(financials[Segment]) works. Your formula:
hashonevalue = IF(HASONEVALUE(financials[Segment]), SUM(financials[Profit]), BLANK())
only returns the profit if exactly one segment is selected. When you select France in the Country slicer, it may still include multiple segments in the data, so HASONEVALUE returns false, and the measure shows blank. This is expected behavior, not a cross-filtering issue.
To confirm how many segments are active under the current filters, you can add:
Selected Segment Count = DISTINCTCOUNT(financials[Segment])
If this count is greater than one, your original measure will remain blank. The measure is working as designed, but the result depends entirely on the data context created by your slicers.
Best regards,