March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Team,
Hope you all are doing fine!
Actually was trying to crreate 3 buttons like last 15 days,last 30 days and other than last 30 days.
I tried achieving this by using below dax but for 30 days condition its giving only last 15 days data.
Solved! Go to Solution.
You mean , in the DAX i need to change month name to month number or in calculated column.
I did not get it, Could you please help me with the understanding.
Thank you very much Rupak_bi and DanielW_ for your prompt reply.
Can you tell me if your problem is solved? If yes, please accept it as solution.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
its working
Make sure you are you are converting month name to month number befor using datediff.
If this solves your topic, please accept as solution.
You mean , in the DAX i need to change month name to month number or in calculated column.
I did not get it, Could you please help me with the understanding.
See, your month column is in text format and "datediff" will work on date format only. So you need to transform month name to month number. Please refer the first variable in my DAX where I have a switch function converting month name to month number. I did it only for two months September and October . this you need to edit for all the months. thats it. your problem will be solved.
I have created a calculated column as a solution, you may use the same dax to create a measure if required.
thanks.
If this solves your problem, please accept as solution.
Year | Month | Day | productfamily | Count | AQ | MQ | S1 | S2 | S3 | Line |
2024 | October | 1 | xxxxx | 1453 | 100.00% | 0.00% | 100.00% | 0.00% | 0.00% | zzzzz |
2024 | October | 1 | yyyyy | 35 | 100.00% | 100.00% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 1 | yyyyy | 206 | 100.00% | 99.51% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 1 | xxxxx | 6838 | 100.00% | 94.79% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 1 | zzzzz | 1705 | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 2 | ttttt | 424 | 100.00% | 0.00% | 100.00% | 0.00% | 0.00% | zzzzz |
2024 | October | 2 | xxxxx | 576 | 100.00% | 0.00% | 100.00% | 0.00% | 0.00% | zzzzz |
2024 | October | 2 | xxxxx | 3292 | 100.00% | 99.64% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 2 | zzzzz | 7758 | 99.94% | 99.73% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 3 | xxxxx | 809 | 100.00% | 84.67% | 100.00% | 0.00% | 0.00% | zzzzz |
2024 | October | 3 | xxxxx | 13083 | 100.00% | 86.07% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 3 | zzzzz | 20258 | 99.80% | 99.80% | 99.99% | 99.92% | 99.89% | yyyyy |
2024 | October | 4 | ttttt | 2 | 100.00% | 0.00% | 100.00% | 0.00% | 0.00% | zzzzz |
2024 | October | 4 | yyyyy | 3 | 100.00% | 100.00% | 100.00% | 0.00% | 0.00% | zzzzz |
2024 | October | 4 | gggg | 6078 | 100.00% | 89.72% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 4 | gggg | 89 | 100.00% | 100.00% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 4 | zzzzz | 3 | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | zzzzz |
2024 | October | 4 | zzzzz | 14808 | 100.00% | 99.97% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 5 | hhhhhhhh | 6713 | 100.00% | 86.30% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 5 | zzzzz | 16509 | 99.98% | 99.27% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 6 | hhhhhhhh | 13844 | 100.00% | 85.96% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 7 | hhhhhhhh | 2073 | 100.00% | 100.00% | 100.00% | 0.00% | 0.00% | zzzzz |
2024 | October | 7 | hhhhhhhh | 14165 | 100.00% | 85.54% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 7 | hhhhhhhh | 1 | 100.00% | 100.00% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 7 | gggg | 102 | 100.00% | 100.00% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 7 | gggg | 574 | 96.86% | 96.86% | 96.86% | 0.00% | 0.00% | xxxxx |
2024 | October | 7 | zzzzz | 13974 | 99.99% | 99.98% | 100.00% | 99.99% | 99.99% | yyyyy |
2024 | October | 8 | hhhhhhhh | 2247 | 100.00% | 100.00% | 100.00% | 0.00% | 0.00% | zzzzz |
2024 | October | 8 | hhhhhhhh | 16111 | 100.00% | 85.92% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 8 | gggg | 96 | 100.00% | 100.00% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 8 | gggg | 83 | 69.88% | 69.88% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 8 | zzzzz | 12652 | 99.95% | 99.94% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 9 | hhhhhhhh | 10391 | 100.00% | 85.80% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 9 | zzzzz | 12118 | 100.00% | 99.98% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 10 | hhhhhhhh | 20410 | 100.00% | 86.07% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 10 | gggg | 94 | 100.00% | 100.00% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 10 | gggg | 29 | 100.00% | 100.00% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 10 | zzzzz | 2176 | 99.95% | 99.95% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 11 | hhhhhhhh | 14951 | 100.00% | 86.01% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 11 | gggg | 80 | 100.00% | 100.00% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 11 | gggg | 658 | 96.35% | 96.35% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 11 | zzzzz | 24607 | 100.00% | 99.94% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 12 | hhhhhhhh | 16617 | 99.99% | 86.01% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 12 | zzzzz | 16546 | 99.99% | 99.94% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 13 | hhhhhhhh | 13860 | 99.99% | 85.53% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 13 | CHAMELEON LG | 297 | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 14 | hhhhhhhh | 19164 | 100.00% | 91.85% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 14 | CHAMELEON LG | 11698 | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 14 | CURIE LG | 48 | 97.92% | 0.00% | 100.00% | 100.00% | 100.00% | zzzzz |
2024 | October | 15 | hhhhhhhh | 21866 | 100.00% | 97.17% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 15 | CHAMELEON LG | 17645 | 100.00% | 99.98% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 15 | CURIE LG | 758 | 100.00% | 0.00% | 100.00% | 100.00% | 100.00% | zzzzz |
2024 | October | 16 | hhhhhhhh | 5410 | 100.00% | 97.01% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 16 | CASSINI LG | 50 | 100.00% | 0.00% | 100.00% | 100.00% | 100.00% | zzzzz |
2024 | October | 16 | CHAMELEON LG | 14525 | 100.00% | 99.99% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 16 | CURIE LG | 1006 | 100.00% | 0.00% | 100.00% | 100.00% | 100.00% | zzzzz |
2024 | October | 17 | hhhhhhhh | 16483 | 100.00% | 87.74% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 17 | CASSINI LG | 390 | 100.00% | 0.00% | 100.00% | 100.00% | 100.00% | zzzzz |
2024 | October | 17 | CHAMELEON LG | 8944 | 100.00% | 99.99% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 18 | hhhhhhhh | 20817 | 100.00% | 86.00% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 18 | CHAMELEON LG | 16221 | 100.00% | 99.98% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 19 | hhhhhhhh | 11854 | 100.00% | 85.56% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 19 | CHAMELEON LG | 15681 | 100.00% | 99.97% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 20 | hhhhhhhh | 13865 | 100.00% | 85.75% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 20 | CHAMELEON LG | 6881 | 100.00% | 99.99% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 21 | hhhhhhhh | 13400 | 100.00% | 85.44% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 21 | CASSINI LG | 985 | 100.00% | 0.00% | 100.00% | 100.00% | 100.00% | zzzzz |
2024 | October | 21 | CHAMELEON LG | 11429 | 100.00% | 99.98% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | October | 22 | hhhhhhhh | 1735 | 100.00% | 99.42% | 100.00% | 0.00% | 0.00% | xxxxx |
2024 | October | 22 | CHAMELEON LG | 124 | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | yyyyy |
2024 | September | 1 | hhhhhhhh | 1568 | 99.11% | 99.11% | 100.00% | 0.00% | 0.00% | xxxxx |
Hi @Heena_9980400 ,
assuming the column [penetestts] is the date combination of [Year], [Month], [Day] in your test data, I believe I was able to created the desired effect witht the folowing dax column:
The SWITCH function is more efficient and makes it easier to read, compared to multiple nested IF-statements.
plz share sample data in plain text here after replacing sensetive data with dummy.
Hi @Heena_9980400
your Dax should work. Alternatively you may try below simplified virsion as well. if doesn't works, check the date formats , else share sample data
Hi @Rupak_bi ,
Thnaks for the response.
still its not giving the correct answer, i checked the date format evrything, its correct.
if i remove "last 15 days ". the last 30 days will correct data.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
18 | |
15 | |
9 | |
8 |
User | Count |
---|---|
37 | |
32 | |
18 | |
16 | |
13 |