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
YunJ
Post Prodigy
Post Prodigy

Why there is always 100% bar?

Hi,

I'm wondering why these 100% shown here. In my original dataset, I don't have such value for these category.

 

Capture.PNG

Capture.PNG

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @YunJ ,

Try to modify your measure like this:

PA depth_LS =
VAR _PA =
    1
        - CALCULATE (
            SUM ( 'Depth Analysis-pbi'[PSP_LS] ),
            FILTER ( 'Depth Analysis-pbi', 'Depth Analysis-pbi'[Type] = "Livestream" )
        )
            / CALCULATE (
                SUM ( 'Depth Analysis-pbi'[RSP] ),
                FILTER ( 'Depth Analysis-pbi', 'Depth Analysis-pbi'[Type] = "Livestream" )
            )
RETURN
    IF ( _PA = 1, BLANK (), _PA )

Is this your expected result?

filter result.png

Best Regards,
Yingjie Li

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

12 REPLIES 12
v-yingjl
Community Support
Community Support

Hi @YunJ ,

Based on my test, the measure you have created has nothing problem. The reason causes this issue is that you have selected slicer as "202002" while there is no data about viya in 202002 about 'Haircare' for example so that you will get 100% using this measure.

old.pngtable.png

To solve this, just clear the slicer and the result may like this:

new.png

In conclusion, the value 100% is not a wrong value, just have no data about it so that it will show 100%.

 

Best Regards,
Yingjie Li

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

Thanks @v-yingjl .But I need to choose YearMonth slicer. If there is no Viya value for 202002, then the bar about her should not show rather than shown as 100%...

Hi @YunJ ,

Try modifying your measure as follows:

PA depth_LS =
VAR _PA =
    1
        - CALCULATE (
            SUM ( 'Depth Analysis-pbi'[PSP_LS] ),
            FILTER ( 'Depth Analysis-pbi', 'Depth Analysis-pbi'[Type] = "Livestream" )
        )
            / CALCULATE (
                SUM ( 'Depth Analysis-pbi'[RSP] ),
                FILTER ( 'Depth Analysis-pbi', 'Depth Analysis-pbi'[Type] = "Livestream" )
            )
RETURN
    IF ( _PA = 1, BLANK (), _PA )

Is this your expected result?

filter result.png

Best looks,
Yingjie Li

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

Hi @YunJ ,

Try modifying your measure as follows:

PA depth_LS =
VAR _PA =
    1
        - CALCULATE (
            SUM ( 'Depth Analysis-pbi'[PSP_LS] ),
            FILTER ( 'Depth Analysis-pbi', 'Depth Analysis-pbi'[Type] = "Livestream" )
        )
            / CALCULATE (
                SUM ( 'Depth Analysis-pbi'[RSP] ),
                FILTER ( 'Depth Analysis-pbi', 'Depth Analysis-pbi'[Type] = "Livestream" )
            )
RETURN
    IF ( _PA = 1, BLANK (), _PA )

Is this your expected result?

filter result.png

Best looks,
Yingjie Li

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

v-yingjl
Community Support
Community Support

Hi @YunJ ,

Try to modify your measure like this:

PA depth_LS =
VAR _PA =
    1
        - CALCULATE (
            SUM ( 'Depth Analysis-pbi'[PSP_LS] ),
            FILTER ( 'Depth Analysis-pbi', 'Depth Analysis-pbi'[Type] = "Livestream" )
        )
            / CALCULATE (
                SUM ( 'Depth Analysis-pbi'[RSP] ),
                FILTER ( 'Depth Analysis-pbi', 'Depth Analysis-pbi'[Type] = "Livestream" )
            )
RETURN
    IF ( _PA = 1, BLANK (), _PA )

Is this your expected result?

filter result.png

Best Regards,
Yingjie Li

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

Thanks a lot! @v-yingjl 

AllisonKennedy
Super User
Super User

UPDATE: @YunJ  sorry, forgot the 1- part, so have updated this below, if you want it shown as blank, then try: 

MEASURE =

VAR calc = CALCULATE(SUM(.....)

RETURN

IF(ISBLANK(calc),BLANK(), 1- calc)

 

Do you want it to be 0 instead? Try putting the CALCULATE part of the function into a VAR:

 

MEASURE =

VAR calc = CALCULATE(SUM(.....)

RETURN

IF(ISBLANK(calc),0, 1- calc)

 

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 

 

If you found this post helpful, please give Kudos.

I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 

https://sites.google.com/site/allisonkennedycv


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Thanks a lot @AllisonKennedy 

Hi @AllisonKennedy I don't want it shown as 0, if there is no value it should not show..

amitchandak
Super User
Super User

@YunJ , have checked your calculation in table visual. I doubt either join is missing. or some problem with the formula. Can not tell without looking at data

Please check the pbix file. Thanks a lot!  https://www.dropbox.com/s/yfc5nahof16iow8/test0513.pbix?dl=0

 

 

 

YunJ
Post Prodigy
Post Prodigy

I found that because there "1-......" in my calculation. so there are 100% bars. But how to solve this...?

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.