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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
moses07_ferns
Regular Visitor

Display Targets against No Sales

I have two tables . Target and Sales Table. I want to show sales for c and d as well with 0 sales and their respective targets. 

 

ProductTarget
A50
B25
C30
D10

 

 

Sales DateProduct Sales
2/1/2018A2
2/2/2018B4
2/3/2018A1
2/4/2018B5
2/5/2018A7
2/6/2018B5
2/7/2018A2
2/8/2018B4
2/9/2018A1
2/10/2018B1
2/11/2018A3
2/12/2018B2
2/13/2018A3
2/14/2018B2
2/15/2018A3
2/16/2018B1
2/17/2018A2
2/18/2018B1

 

Desired Result :

Product SalesTarget
A2450
B2525
C030
D010
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @moses07_ferns ,

Depending on the information you have provided, you can add a new measure:

SALES_ =
VAR _PRODUCT =
    SELECTEDVALUE ( 'Sales Table'[Product ] )
VAR _RESULT =
    CALCULATE (
        SUM ( 'Sales Table'[Sales] ),
        FILTER ( 'Sales Table', 'Sales Table'[Product ] = _PRODUCT )
    )
RETURN
    IF ( _RESULT > 0, _RESULT, 0 )

Final output:

vyifanwmsft_0-1714441684853.png

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @moses07_ferns ,

Depending on the information you have provided, you can add a new measure:

SALES_ =
VAR _PRODUCT =
    SELECTEDVALUE ( 'Sales Table'[Product ] )
VAR _RESULT =
    CALCULATE (
        SUM ( 'Sales Table'[Sales] ),
        FILTER ( 'Sales Table', 'Sales Table'[Product ] = _PRODUCT )
    )
RETURN
    IF ( _RESULT > 0, _RESULT, 0 )

Final output:

vyifanwmsft_0-1714441684853.png

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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