Forum Discussion

bdehning's avatar
bdehning
Icon for Post Prodigy rankPost Prodigy
2 years ago
Solved

Dax Help on showing 0 Count for Column Chart

I am trying the following for Y Axis on a chart but not seeing any months of 0 count like I want.   How could I tweak this?   Test Count of Total Gross Incurred +0 =   VAR __Max = MAX('CalendarTa...
  • Ritaf1983's avatar
    2 years ago

    Hi bdehning 
    If the graph is based on a date table.
    try to modify 
      VAR __Result = IF(__RT = 0BLANK(), __Count)
    to just  __Count
    if the result is blank()
    the months are not shown..

     

    another option is to use 
    "show items without data" 

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

  • Ritaf1983's avatar
    Ritaf1983
    2 years ago

    Hi bdehning 
    There is a link for a more efficient method to handle the blanks/0 issues.

    https://www.youtube.com/watch?v=_cT9PB72fu8&t=1537s

    if it doesn't help 

    Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
    https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
    Please show the expected outcome based on the sample data you provided.

    https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

     

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

  • Ritaf1983's avatar
    Ritaf1983
    2 years ago

    Hi bdehning 
    Again without data, I am not sure that I understand you correctly.
    If you want to filter out dates that are after the last date in the fact table,
    You can create flag measure like:
    flag = if (MAX('CalendarTable'[Dates])<=  MAX ( 'LossRun'[Loss Date] ) && (min('CalendarTable'[Dates])>= min ( 'LossRun'[Loss Date] ),1,0)
    and use this flag as a filter on the graph

    Hopefully, it can help...

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

  • Ritaf1983's avatar
    Ritaf1983
    2 years ago

    Hi bdehning 
    Yes, and I must admit that I didn't understand the model.
    There are many to many relationships,
    The fact table doesn't relate to the calendar...
    Very strange measure.

    Sorry, the issue is much deeper than the question that you asked.