Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Formula for gauge visual

Hello Community  =  I am trying to create a measure/column  that would isolate just the Row A from below.   

 

I need to compare Row A's percent value against a KPI target  (I will use a gauge visual).    I have created the simple Target measure.   But am wondering how to create the formula that would go in the value area of the gauge visual.   So essentially what I need to end up with a gauge visual that shows we are at 71.10%  relative to a 95% target.   

 

Total Number of Shipments2 = CALCULATE(DISTINCTCOUNT('Flu Shipped by Order Date'[Order]),FILTER('Flu Shipped by Order Date','Flu Shipped by Order Date'[DateShipped]))
 
The first column is just using the manually created groups using the "groups" feature  (not GROUPBY).  
 
The second column is this:   
Total Number of Shipments2 = CALCULATE(DISTINCTCOUNT('Flu Shipped by Order Date'[Order]),FILTER('Flu Shipped by Order Date','Flu Shipped by Order Date'[DateShipped]))
 
The % of Total is just the same as the 2nd column, with the option to show the column as a % of grand total.   
 
 

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous 

    I think your Total Shipments and % of Total are all measures.

    Due to I don't know your data model, I build a sample to have a test.

    My sample:

    Measure = 
    DISTINCTCOUNT('Flu Shipped by Order Date'[Order])
    Total Shippments = SUMX(VALUES('Flu Shipped by Order Date'[Type]),[Measure])
    %Total = [Total Shippments]/SUMX(ALL('Flu Shipped by Order Date'[Type]),[Measure])
    A percentage = CALCULATE([%Total],FILTER('Flu Shipped by Order Date','Flu Shipped by Order Date'[Type] = "A. Four Days or Less"))
    Target = 0.95

    Result is as below.

    You can download the pbix file from this link: Formula for gauge visual

    If this reply still couldn't help you solve your problem, please share a sample with me by your Onedrive for Business.

     

    Best Regards,

    Rico Zhou

     

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

     

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    I think your Total Shipments and % of Total are all measures.

    Due to I don't know your data model, I build a sample to have a test.

    My sample:

    Measure = 
    DISTINCTCOUNT('Flu Shipped by Order Date'[Order])
    Total Shippments = SUMX(VALUES('Flu Shipped by Order Date'[Type]),[Measure])
    %Total = [Total Shippments]/SUMX(ALL('Flu Shipped by Order Date'[Type]),[Measure])
    A percentage = CALCULATE([%Total],FILTER('Flu Shipped by Order Date','Flu Shipped by Order Date'[Type] = "A. Four Days or Less"))
    Target = 0.95

    Result is as below.

    You can download the pbix file from this link: Formula for gauge visual

    If this reply still couldn't help you solve your problem, please share a sample with me by your Onedrive for Business.

     

    Best Regards,

    Rico Zhou

     

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