Forum Discussion

Bharathpowerbi's avatar
Bharathpowerbi
New Member
1 year ago
Solved

Regarding hash one value dax function

Regarding hash one Value dax function it supports cross filter right it is not working. Created hashonevalue on segment column trying to filter on country column but not filtering.  
  • DataNinja777's avatar
    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,