cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Rate Regular Visitor
Regular Visitor

Grouped Chart with Measure with Calculate as Value.

Hello!

I am struggling with something I can't quite understand, and I am going sort of nuts.

 

I have a Data Table, no relations whatsoever, where I have a line for each Task our workforce is doing. They are sending information on the visits to stores, and checking if there is a Stock Shortage (or not) and the reason behind the shortage when there is.

 

I am trying to show a simple column chart with the following data:

- Values: A measure, where I guess my problem is coming from: 

Visit with Shortage =
CALCULATE(
        DISTINCTCOUNT(Task[ID Task]);
        Task[Shortage] <> "No Shortage")

- Axis: The column "Shortage", where there are text values, one per line, with the detail for the shortage or, if there is no shortage, the text "No Shortage".

 

As an example, the table I am testing with is this:

ID TaskShortage
1No Shortage
2No Shortage
3Other
4Other
5Full
6Other

 

I would want a chart with the count of tasks with the type of shortage, but not the column with "No Shortage". The graph I am obtaining is this one:Screenshot_1.png

 

 

I know that I could simply add a filter to the chart, but I am more interested in learning the reason why this is not working as I intend.

 

Thanks a lot!!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Grouped Chart with Measure with Calculate as Value.

Hi @Rate ,

 

To update your measure as below.

 

Visit with Shortage = 
VAR st =
    MAX ( 'Task'[Shortage] )
RETURN
    IF ( st <> "No Shortage", DISTINCTCOUNT ( Task[ID Task] ), BLANK () )

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
RobbeVL Established Member
Established Member

Re: Grouped Chart with Measure with Calculate as Value.

Hi,

 

Your calculation actually doesnt make much sense.

You are trying to filter your measure, while you actually need to filter your axis.

 

You could create a more "complex" measure to filter out no shortage, but filtering your visual or dataset would make alot more sense.

 

Robbe

Community Support Team
Community Support Team

Re: Grouped Chart with Measure with Calculate as Value.

Hi @Rate ,

 

To update your measure as below.

 

Visit with Shortage = 
VAR st =
    MAX ( 'Task'[Shortage] )
RETURN
    IF ( st <> "No Shortage", DISTINCTCOUNT ( Task[ID Task] ), BLANK () )

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Rate Regular Visitor
Regular Visitor

Re: Grouped Chart with Measure with Calculate as Value.

Hello @v-frfei-msft ,

 

That worked like a charm! Thank you so much!

 

Regards!

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 37 members 1,009 guests
Please welcome our newest community members: