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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
JFG1234
Frequent Visitor

Graph items with no data from measure

I have this visualisation (graph) and accomodating table:

JFG1234_0-1679640850533.png

 

The promoted count and status count are based off the following measures:

 

 

Promoted Count = 
var prom_count = 
CALCULATE(
    COUNTA([Status]),
    FILTER(Table,[Status] = "Promoted")
)
return
if(isblank(prom_count),0,prom_count)

 

and

 

Status Count = counta([Status])

 

The underlying 'Table' has row by row people by state and by year and whether they were promoted ('Status') or not in that year. In the above example vis you can see that no one from TAS was promoted in 2015,2018-2022, however rather than the measures counting the abscense of promotions as 0 it does not return anything. This leads to a poor visualisation, for the years where there are no records of promoted people the value in the table should be 0, instead because it is missing it joins the records together. Something like the below;

JFG1234_0-1679641441340.png

 

 

1 ACCEPTED SOLUTION

Fixed it by creating a dimension year table and using that YEAR dimension instead of aggregating over the YEAR column in the source data.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

There is this "trick"  to add 0 to a measure that may return BLANK().  Not a great thing but maybe give it a try.

This does not seem to work. I added 0 to all of the above measures and had no luck.

 

Promoted Count = 

var prom_count = 
CALCULATE(
    COUNTA([Status]),
    FILTER(Hockey_About_Years_Cross,[Status] = "Promoted")
)

return
if(isblank(prom_count),0,prom_count) + 0

 

Status Count = 
var status_count = counta([Status]) + 0
return
if(isblank(status_count),0,status_count) + 0

Fixed it by creating a dimension year table and using that YEAR dimension instead of aggregating over the YEAR column in the source data.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors