Forum Discussion
Anonymous
6 years agoNot applicable
Dax calc help
Hello All, I want help in formulating DAX for my use case. Sample data is below. I want to show/FILTER only those rows whose latest month (MAR) value is >0. Creating a if statement on the value...
- Anonymous6 years ago
Hi Anonymous,
According to your description, your table seems to contain multiple month fields with values and you are try to filter on them to hide the last month records that than less than zero?
If this is a case, I'd like to suggest you do unpivot columns on your month fields to convert them to attitude and value fields.
Then you can write a measure formula and use on 'visual level filter' to filter last month records.
Applying a measure filter in Power BI
measure = VAR list = ADDCOLUMNS ( VALUES ( Table[Attribute] ), "Date", DATEVALUE ( [Attribute] & "/1" ) ) VAR _lastMonth = MAXX ( list, [Date] ) VAR currValue = CALCULATE ( SUM ( Table[Value] ), FILTER ( ALLSELECTED ( Table ), [Attribute] = FORMAT ( _lastMonth, "MMM" ) ), VALUES ( Table[Name] ) ) RETURN IF ( SELECTEDVALUE ( Table[Attribute] ) = FORMAT ( _lastMonth, "MMM" ) && currValue > 0, "Y", "N" )Regards,
Xiaoxin Sheng
Anonymous
6 years agoNot applicable
HI Anonymous ,
Create a visual filter
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)