Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RajK2
Helper V
Helper V

SELECTED VALUE While unselect

Team

I have filter table = List[levels)

if list(levels) selected then the dax formula works if unselect filter then it showing as blank data

my question here is if filter applied then show filter data else show ALL.. what is DAX Formula ?

 

VAR _mod = SELECTEDVALUE('List'[Levels])


RETRUN CALCULATE(-SUM('Data'[amount])/1000000,
'GPS'[File] =_mod,
'GPS'[File2] ="CDS"
)

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @RajK2  - you can modify your DAX to check if a selection exists in 'List'[Levels]. If a filter is applied, it should use the selected value

 

VAR _mod = SELECTEDVALUE('List'[Levels])

RETURN
CALCULATE(
-SUM('Data'[amount]) / 1000000,
'GPS'[File] = IF(ISBLANK(_mod), 'GPS'[File], _mod),
'GPS'[File2] = "CDS"
)

 

please check the above and hope it works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@RajK2 Try:

VAR _mod = SELECTEDVALUE('List'[Levels])

VAR _result = 
  IF( _mod = BLANK(),
    CALCULATE(-SUM('Data'[amount])/1000000, 'GPS'[File2] ="CDS"),
    CALCULATE(-SUM('Data'[amount])/1000000, 'GPS'[File] =_mod, 'GPS'[File2] ="CDS" )
  )
RETURN
  _result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
rajendraongole1
Super User
Super User

Hi @RajK2  - you can modify your DAX to check if a selection exists in 'List'[Levels]. If a filter is applied, it should use the selected value

 

VAR _mod = SELECTEDVALUE('List'[Levels])

RETURN
CALCULATE(
-SUM('Data'[amount]) / 1000000,
'GPS'[File] = IF(ISBLANK(_mod), 'GPS'[File], _mod),
'GPS'[File2] = "CDS"
)

 

please check the above and hope it works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.