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 All,
I am struggling with a DAX filter/parameter.
Scenario: Our client has an external application from which the user will select certain parameters for a report. These will be passed to a PBI paginated report developed in Report Builder to generate. The source for this paginated report is a PBI shared dataset. This process works 100%.
Problem: If the user wants to select “all” companies for example, the word “all” or -1, needs to be passed to the report. If the report receives the word “all” or -1, the filter part in the DAX code needs to be ignored. I am not familiar with DAX and had to stick the internet to find solutions, but no luck.
This is just one the DAX examples I’ve tried:
EVALUATE SUMMARIZECOLUMNS('M_Image'[ID], IF(RSCustomDaxFilter(@MRIImageID,EqualToCondition,[M_Image].[ID],Int64) = -1
,IGNORE(RSCustomDaxFilter(@MRIImageID,EqualToCondition,[M_Image].[ID],Int64)))
Basically – if the parameter passed to the report = -1, then do not use the filter, else use the filter.
Any ideas?
Many thanks!
filter(
Something,
Something[OtherSomething] = "SomethingOther"
|| @YourVariable = "all"
)
or... you can UNION two SUMMARIZECOLUMNS queries where one of them will return an empty set depending on the value of a variable. There are many ways you can achieve what you want.
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
8 | |
6 |