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 all
I want to run a query in Advanced Editor, only if the current date is NOT one of the following - 1, 5, 10, 15, 20, 25. Otherwise I dont want the query to run.
I have written the below but I am not getting anywhere very fast:
let
Output = if Date.Day (DateTime.LocalNow()) in (1,5,10,15,20,25) then null else
let
Source = PBILifts
in
#"PBILifts"
What am I doing wrong?
Cheers for all help
Solved! Go to Solution.
My bad. Please try this approach instead. I assume PBILifts is an existing query.
let
Output = if List.Contains({1,5,10,15,20,25}, Date.Day(DateTime.LocalNow())) then null else PBILifts
in
Output
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
You have two let and only one in. Add in Output
Regards
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thanks @mahoneypat I have changed to the below but I still get an error:
let
if Date.Day (DateTime.LocalNow()) in (1,5,10,15,20,25) then null else
Source = PBILifts
in
#"PBILifts"
Any clues please?
Hi @ansa_naz ,
I have tested the method that @ansa_naz suggested. It works fine in my sample. I add a few document about M. Then you could reference them to learn more about it.
Quick tour of the Power Query M formula language
If you have resolved the problem, please accept the helpful answers as solution. More people will benefit from this thread. If you still need help, please share a few screenshots and show us the expected results. We will understand clearly.
My bad. Please try this approach instead. I assume PBILifts is an existing query.
let
Output = if List.Contains({1,5,10,15,20,25}, Date.Day(DateTime.LocalNow())) then null else PBILifts
in
Output
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
User | Count |
---|---|
87 | |
72 | |
69 | |
64 | |
56 |
User | Count |
---|---|
99 | |
92 | |
84 | |
74 | |
66 |