Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Friends,
I need help writing this measure. Here is a sample data.
Plan Year Amt
Plan 1 2019 30
Plan 1 2020 40
Plan 1 2021 15
Plan 2 2015 20
Plan 2 2018 20
Plan 2 2020 10
I want a DAX to return me 'Plan 1' with all the columns, as Plan 1 Year 2020 met the condition Amt > 35. The output should be like this, How to do that?
Solved! Go to Solution.
Hi @amit_msmba ,
I created a sample pbix file(see the attachment), please check if that is what you want. You can create the measures below to get it and apply a visual-level filter on your table visual with the condition(Flag is 1😞
Sum of Amt = SUM('Table'[Amt])
Flag =
VAR _plan =
SELECTEDVALUE ( 'Table'[Plan] )
VAR _tab =
CALCULATETABLE (
VALUES ( 'Table'[Plan] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Plan] = _plan && [Sum of Amt] > 35 )
)
RETURN
IF ( _plan IN _tab, 1, 0 )
Best Regards
Hi @amit_msmba ,
I created a sample pbix file(see the attachment), please check if that is what you want. You can create the measures below to get it and apply a visual-level filter on your table visual with the condition(Flag is 1😞
Sum of Amt = SUM('Table'[Amt])
Flag =
VAR _plan =
SELECTEDVALUE ( 'Table'[Plan] )
VAR _tab =
CALCULATETABLE (
VALUES ( 'Table'[Plan] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Plan] = _plan && [Sum of Amt] > 35 )
)
RETURN
IF ( _plan IN _tab, 1, 0 )
Best Regards
The lazy way is to just use a visual-level filter and set Sum of Amt > 35.
If you need it in DAX, try:
Sum of Amt =
var sumOfAmt = SUM(Amt)
return IF(sumOfAmt > 35, sumOfAmt, BLANK())
The BLANK() is optional, but it helps with readability in my opinion.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |