The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |