Forum Discussion

Bhaskar1986's avatar
Bhaskar1986
Frequent Visitor
2 years ago

Power BI. Need support

I want show zero for the week number were they dont have volume for the particular week in the line chart

6 Replies

  • Dhairya's avatar
    Dhairya
    Icon for Solution Supplier rankSolution Supplier

    Hey Bhaskar1986 

    You can display zero by just adding  "+0" at the end of your measure.
    For example you are plotting measure named "Total Volume"
    where you can create measure as below
    Total Volume = SUM(Table[volume]) + 0

    This will add zero when record are null in particular week.

    If this helps you then please mark my solution as accepted so that others can find it quickly while facing the similar issue. Thank You!

    • Bhaskar1986's avatar
      Bhaskar1986
      Frequent Visitor

      Actual soultion for my request is

      CountofActivity = if(isblank(count('Monthly Data'[Activity Name ]))=TRUE,0,COUNT('Monthly Data'[Activity Name ]))

       

      Thank you so much for your support and valuable time. Kindly suppor in future as well for all my queries. 

  • Bhaskar1986's avatar
    Bhaskar1986
    Frequent Visitor

    I am sorry this suggestion is not helped me.

    This is for reference. I want to show the zero for the missing week. Here i am pulling the value as Activity name column which is string and i directly pulling the call in the Value field and it is automatically convert to count. This activity count is mapped with Week number column from calender table

     

    • Dhairya's avatar
      Dhairya
      Icon for Solution Supplier rankSolution Supplier

      Hey Bhaskar1986 

      Instead of plotting the Activity column directly, create the following measure and plot it

      Number of Activities = COUNT('Table Name'[Activity name]) + 0
      or 
      Number of Activities = COUNTROWS(TableName) + 0

      If still you are facing issues then please share sample input data and expected output. and if it works then please mark my solution as accepted and kudo the post so that others can find it quickly while facing a similar issue. Thank You!

    • Bhaskar1986's avatar
      Bhaskar1986
      Frequent Visitor

      Hi Dhairya, Thankyou for your kind support. Also for your quick reference i have attached the screen shot that the suggestion which is given to me is applied but still i am not getting the zero value for the missing week.

       

      Note: The weeknum is pulled from calender_table which has relationship with Monthly_data table (Y-Axis). Where i do have the activity_Names which i pulled to show the count of activity in the line chart. So here when there is no activity count for a particular week in the Montly_data table that week in the calender_table(X-Axis) should show as zero.

      Hope you understand the logic.