Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi community,
I have two tables called Article and Article7, they both have the same schema (Title, id..) but one is on full import mode and the other uses direct query. I'm creating a table visual in my report and I want it to switch between including the Title text field from Article and Article7 based on some measure I created that returns True or False (which act like a condition, if True the Title from Article , else Title from Article7). This seems challenging with DAX because DAX only returns single values and not whole columns, also Virtual tables use import mode and in this case I'm dealing with both Import and Direct Query.
One other solution I was trying using Field Parameters, where I added both Titles from the two tables, then altered the auto generated code and added an If statement based on my condition measure :
The issue with this; the IF statement condition is always evaluating as True, even when [past] is False and so it's always returning the Title from Article table, never from Article7 ( [past] is working properly outside this ). I also tried replacing [past] with simple conditions like 1=1 or 1=2 just for testing, and it works.
That's [past] :
[past] measure calculates the number of days between the earliest date in Calendar table and today, then compares it with a given value (400) and returns True or False.
I use this filter to filter out the Date in Calendar table and reduce the earliest date, but it looks like the field parameter DAX code is not considering this filter and only evalutes [past] the moment it was created.
I tried to add the date filter in the [past] formula itself and it worked, but in my case I want this DATEVALUE to be dynamically changed using the filter above.
Any help or suggestion on this ?
Feel free to propose another way to switch between the two columns as well.
Thank you.
hello @t4h4 ,
Try to use field parameters to switch between thses two columns
https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Proud to be a Super User! | |
Thanks for replying,
That's exactly what I was trying to do. However, I want the switching between the two columns to be automatically done based on my measure [past] mentioned above. I altered the default generated DAX code for the field parameters to achieve that... but that code is having issues.
User | Count |
---|---|
90 | |
74 | |
67 | |
63 | |
55 |
User | Count |
---|---|
101 | |
92 | |
74 | |
60 | |
59 |