Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Matrix with Weekly Data Columns and String Values

I'm new to PowerBI and I'm trying to create the visualization below and am having trouble because of a few areas:        1. I am getting an error with dates because there are gaps in the dates ...
  • MFelix's avatar
    7 years ago

    Hi  Anonymous,

     

    I'm assuming that you want to return Yes when measure is greater than target.

     

    Use the following measure to add to your matrix:

     

    YES / NO = 
    IF (
        HASONEFILTER ( Data[Week Starting] );
        IF ( SUM ( Data[Measure] ) < SUM ( Data[Target] ); "No"; "Yes" );
        COUNTROWS (
            FILTER (
                SUMMARIZE (
                    Data;
                    Data[Week Starting];
                    "YES/NO"; SUM ( Data[Measure] ) - SUM ( Data[Target] )
                );
                [YES/NO] > 0
            )
        )
    )

    Regards,

    MFelix

  • MFelix's avatar
    MFelix
    7 years ago

    Hi Anonymous,

     

    Select the date column then select the modeling on the bar and format the date as you need.

     

     

     

    Regards,

    MFelix