Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
105 | |
88 | |
73 | |
66 |
User | Count |
---|---|
124 | |
113 | |
98 | |
81 | |
72 |