Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lonestar
Frequent Visitor

calculated measure in line chart

Hi all,

 

I would like some help about a little problem that i am facing

 

I have created a new measure to calculate sla

the formula tha i used is

SLA% = 1-((COUNTAx(FILTER(grid_raw;grid_raw[IN_SLA]=0 && grid_raw[EXCLUDE_VISIT]=0);grid_raw[VISIT_MADE]))/(COUNTAX(FILTER(grid_raw;grid_raw[VISIT_MADE]=1);grid_raw[VISIT_MADE])))
 

Eventhough it seems to work fine the problem is when i use this field (SLA%) in a line chart , it displays values even for months without any data

 

as you can see below

I have date until december 2020 but it shows results until the end of 2021

 

Any ideas??

 

 

Thank you very much in advance

 

 

 

lonestar_1-1610045716591.png

 

lonestar_2-1610045746433.png

 

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@lonestar try this

 

SLA% = 
VAR __result = ((COUNTAx(FILTER(grid_raw;grid_raw[IN_SLA]=0 && grid_raw[EXCLUDE_VISIT]=0);grid_raw[VISIT_MADE]))/(COUNTAX(FILTER(grid_raw;grid_raw[VISIT_MADE]=1);grid_raw[VISIT_MADE])))
RETURN 
IF ( __result <> BLANK(), 1 - __result )

 

Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

9 REPLIES 9
parry2k
Super User
Super User

@lonestar so that is your problem, you have to find out why it is returning blank(), not 100%



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@lonestar not sure why, if you just return __result without if condition, what you see. Is it coming out blank()



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Yeap ...empty

 

SLA% =
VAR __result = ((COUNTAx(FILTER(grid_raw;grid_raw[IN_SLA]=0 && grid_raw[EXCLUDE_VISIT]=0);grid_raw[VISIT_MADE]))/(COUNTAX(FILTER(grid_raw;grid_raw[VISIT_MADE]=1);grid_raw[VISIT_MADE])))
RETURN
__result

 

lonestar_1-1610060081561.png

 

 

lonestar_0-1610060059036.png

 

parry2k
Super User
Super User

@lonestar sorry not sure what you mean? Can you provide some screenshots to explain it?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

The actual data for october and december is 100% but with the solution proposed is been filtered out

 

I hope i made my self clear.....sorry

 

lonestar_3-1610058948810.png

 

lonestar_2-1610058917935.png

 

 

 

 

 

lonestar
Frequent Visitor

Work like a charm!

Thank you very much!!!

AlB
Super User
Super User

Hi @lonestar 

Try something like:

SLA% =
VAR aux_ =
    DIVIDE (
        COUNTAX (
            FILTER ( grid_raw; grid_raw[IN_SLA] = 0 && grid_raw[EXCLUDE_VISIT] = 0 );
            grid_raw[VISIT_MADE]
        );
        COUNTAX ( FILTER ( grid_raw; grid_raw[VISIT_MADE] = 1 ); grid_raw[VISIT_MADE] )
    )
RETURN
    IF ( NOT ISBLANK ( aux_ ); 1 - aux_ )

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

parry2k
Super User
Super User

@lonestar try this

 

SLA% = 
VAR __result = ((COUNTAx(FILTER(grid_raw;grid_raw[IN_SLA]=0 && grid_raw[EXCLUDE_VISIT]=0);grid_raw[VISIT_MADE]))/(COUNTAX(FILTER(grid_raw;grid_raw[VISIT_MADE]=1);grid_raw[VISIT_MADE])))
RETURN 
IF ( __result <> BLANK(), 1 - __result )

 

Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

The only issue is that even when 100% is valid (based on data ie  Dec 2020 ) doesnt  appear with this suggestion

 

any thoughts?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.