Forum Discussion
Use clause Where in Dax
Column = CALCULATE('Table'[Column],AND('Table'[datedemand] >= 20220530,'Table'[datedemand] <= 202205))
Try this! Or this:
Column = CALCULATE('Table'[Column],DATESBETWEEN(<dates>, <start_date>, <end_date>))
thank you for your answer but datedemand between '20210201' and '20220530' is used from a segment so the problem is how implemented or (qte<>qtelivree and datedemande >= to_date('20210201','YYYYMMDD') - interval '3 month' and requestdate <= '20220530');
I tried this:
Mesure 2 =
CALCULATE(
nouvelleMesure[Mesure],
OR(
DATESINPERIOD('Table'[datedemande],
MAX('Table'[datedemande]),
-3,MONTH),
[qte moins qtelivree]<>0)
)but it does not work
- v-zhangti4 years ago
Community Support
Hi, sow0006
Can you explain the meaning of the statement again?
WHERE ((datedemand between '20210201' and '20220530') or (qte<>qtelivree and datedemande >= to_date('20210201','YYYYMMDD') - interval '3 month' and datedemande <= '20220530'))What do you expect the output to look like? Can you show it in a picture?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- sow00064 years agoFrequent Visitor
Hi v-zhangti
The request is to calculate the delivery delays and the output is to have the number of hours expected.
SELECT SUM(hprevues)/360000 AS totalhp FROM plannifoperateur WHERE ((datedemand between '20210201' and '20220530') or (qte<>qtelivree and datedemande >= to_date('20210201','YYYYMMDD') - interval '3 month' and datedemande <= '20220530'))- v-zhangti4 years ago
Community Support
Hi, sow0006
Can you provide some sample data or simple pbix files? Sensitive information can be removed in advance.
How to provide sample data in the Power BI Forum - Microsoft Power BI Community
Best Regards