Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
BaronSdG
Helper V
Helper V

Show open items from the last 30 days

Hello,
 
On another thread I was helped with a formula to compute my closed items like the one below. I have tried it again for my open items, but is not working and the difference is that when selecting the column with the date ('Jira Datalake'[Created]), Power BI also asks me to add an extra field (such as .[Date]), but it's not working. I have tried leaving that field empty, using .date, .day but still is not working. 
 
_Count_Open_30days_dynStr =
VAR created = CALCULATE([Count_Rows_J],FILTER('Jira Datalake','Jira Datalake'[Status Open vs Closed items (groups)] = "Closed" && 'Jira Datalake'[Created].[Date] >= TODAY()-30))
 
Can you help me?
5 REPLIES 5
v-jayw-msft
Community Support
Community Support

Hi @BaronSdG ,

 

Based on my test, no matter if you used .[date] or not, the formula should give you right result. It's better to share some sample data to us.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hi @v-jayw-msft ,

 

Let me share with you the formula which is working for the closed items:

 

Measure 1:
Count_Rows_J = COUNTROWS('Jira Datalake')
 
Measure 2:
_Count_Closed_30days_dynStr =
VAR created = CALCULATE([Count_Rows_J],FILTER('Jira Datalake','Jira Datalake'[Status Open vs Closed items (groups)] = "Closed" && 'Jira Datalake'[Closed] >= TODAY()-30))
 
Measure 3:
_Count_Open_30days_dynStr =
VAR created = CALCULATE([Count_Rows_J],FILTER('Jira Datalake','Jira Datalake'[Status Open vs Closed items (groups)] = "Closed" && 'Jira Datalake'[Created] >= TODAY()-30))
 

Hi @BaronSdG ,

 

The syntax of your formula is incorrect. You are using VAR but not using Return after it. In addition, i can't found any difference between measure2 and measure3. It's better to show some sample data and expected result to us so that we can wirte DAX for you.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
parry2k
Super User
Super User

@BaronSdG you should remove .[Date] part, it is a hidden table, as best practice, you should turn it off and use date dimension for you calculations. As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-ca...

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

So do I have to remove only .[Date] (as below) or do I also need to do the steps you have mentioned later on?

 

VAR created = CALCULATE([Count_Rows_J],FILTER('Jira Datalake','Jira Datalake'[Status Open vs Closed items (groups)] = "Closed" && 'Jira Datalake'[Created] >= TODAY()-30))

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.