Forum Discussion

MaadiKemko's avatar
MaadiKemko
Frequent Visitor
9 years ago
Solved

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.

 

 

 

 

 

 

Thanks in advance,

MaadiKemko

  • MaadiKemko's avatar
    MaadiKemko
    9 years ago

    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.

  • 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

5 Replies

  • HarrisMalik's avatar
    HarrisMalik
    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

    • MaadiKemko's avatar
      MaadiKemko
      Frequent Visitor

      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.

      • BhaveshPatel's avatar
        BhaveshPatel
        Super User

        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