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

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.

Reply
MaadiKemko
Frequent Visitor

Power BI Current Month Count

 

 

Hi all,

 

I am a newbie in Power BI.

Please find the below product list and the date sold out.

Can any one help me to find the the No. of Products sold in the "Current Month" using Power BI.

 

 

Capture.JPG

 

 

 

 

Thanks in advance,

MaadiKemko

3 ACCEPTED SOLUTIONS

Thanks for your reply Harris.

 

As you mentioned, I have tried to create a custom coloum using Power BI Query Editor.

But I am getting the below error. 

Let me know what is the issue here.

Capture.JPG

View solution in original post

Hi 

 

You created a column in query mode. For this solution, You need to create a calculated column in your table

 

After loading your query in data model, select the table and right click.  

Select new column and write this DAX Expression for it to work.

 

 

Thanks & Regards,

Bhavesh

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

@MaadiKemko it is a DAX expression which works as @BhaveshPatel mentioned. You are trying to use DAX in M Query editor.

View solution in original post

5 REPLIES 5
HarrisMalik
Continued Contributor
Continued Contributor

@MaadiKemko This can be done easily by adding a column for current month. Some thing like this:

 

In your model add a New Column

 

IsCurrentMonth = IF(MONTH(Sales[Soldon])=MONTH(TODAY()),"Yes","No")

 

Now use your ProductName with aggregation type Count in a visual like Card. Use the newly created column as slicer and its done.

 

Regards

Harris

Thanks for your reply Harris.

 

As you mentioned, I have tried to create a custom coloum using Power BI Query Editor.

But I am getting the below error. 

Let me know what is the issue here.

Capture.JPG

@MaadiKemko it is a DAX expression which works as @BhaveshPatel mentioned. You are trying to use DAX in M Query editor.

 

 

I  have done changes as you mentioned.

There is one currection in the formula. If we use the above mentioned formula, will get month but that will not check the year.

So I modified the formula as below and now the result is showing as expected.

 

Capture.JPG

 

Thanks a lot @HarrisMalik and @BhaveshPatel

Hi 

 

You created a column in query mode. For this solution, You need to create a calculated column in your table

 

After loading your query in data model, select the table and right click.  

Select new column and write this DAX Expression for it to work.

 

 

Thanks & Regards,

Bhavesh

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.