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
rds_2019
Helper I
Helper I

Can we have different reference value and show value

hi All,

Can we have different value in Bar chart from visual purpose and reference purpose.

So what i want is on x axis. Value should be sorted based on the Date (24th Sept, 25 Sept,25 Sept,25 Sept, 26 Sept etc)

but where as when it shws on the bar it should show like 

 

24th Sept

25th Sept_Test1

25th Sept_Test2

25th Sept_Test3

26th Sept

 

Is it possible

 

Cheers,

RDS

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @rds_2019 ,

Try this:

IsDistinct = 
IF (
    CALCULATE ( COUNT ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Date] ) ) = 1,
    1,
    0
)
Date_Test = 
VAR Rank_of_not_IsDistinct =
    RANKX (
        FILTER ( 'Table', 'Table'[IsDistinct] = 0 ),
        'Table'[Date] + 'Table'[Value] / 10000,
        ,
        ASC,
        DENSE
    )
VAR Test =
    IF (
        'Table'[IsDistinct] = 0,
        CONCATENATE ( "Test", Rank_of_not_IsDistinct ),
        BLANK ()
    )
VAR Day =
    IF (
        DAY ( 'Table'[Date] ) = 1
            || DAY ( 'Table'[Date] ) = 1
            || DAY ( 'Table'[Date] ) = 21
            || DAY ( 'Table'[Date] ) = 31,
        CONCATENATE ( DAY ( 'Table'[Date] ), "st" ),
        IF (
            DAY ( 'Table'[Date] ) = 2
                || DAY ( 'Table'[Date] ) = 22,
            CONCATENATE ( DAY ( 'Table'[Date] ), "nd" ),
            IF (
                DAY ( 'Table'[Date] ) = 3
                    || DAY ( 'Table'[Date] ) = 23,
                CONCATENATE ( DAY ( 'Table'[Date] ), "rd" ),
                CONCATENATE ( DAY ( 'Table'[Date] ), "th" )
            )
        )
    )
VAR Month_Name =
    LEFT ( FORMAT ( 'Table'[Date], "mmmm" ), 4 )
VAR Date_Test_1 =
    CONCATENATE ( CONCATENATE ( Day, " " ), Month_Name )
VAR Date_Test_2 =
    CONCATENATE (
        CONCATENATE ( CONCATENATE ( CONCATENATE ( Day, " " ), Month_Name ), "_" ),
        Test
    )
VAR Date_Test =
    IF ( 'Table'[IsDistinct] = 1, Date_Test_1, Date_Test_2 )
RETURN
    Date_Test

 distinct.PNG

PBIX file attached.

 

Best Regards,
Icey

 

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

3 REPLIES 3
Icey
Community Support
Community Support

Hi @rds_2019 ,

 

Is this problem solved?


If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.


If not, please let me know.


Best Regards
Icey

Icey
Community Support
Community Support

Hi @rds_2019 ,

Try this:

IsDistinct = 
IF (
    CALCULATE ( COUNT ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Date] ) ) = 1,
    1,
    0
)
Date_Test = 
VAR Rank_of_not_IsDistinct =
    RANKX (
        FILTER ( 'Table', 'Table'[IsDistinct] = 0 ),
        'Table'[Date] + 'Table'[Value] / 10000,
        ,
        ASC,
        DENSE
    )
VAR Test =
    IF (
        'Table'[IsDistinct] = 0,
        CONCATENATE ( "Test", Rank_of_not_IsDistinct ),
        BLANK ()
    )
VAR Day =
    IF (
        DAY ( 'Table'[Date] ) = 1
            || DAY ( 'Table'[Date] ) = 1
            || DAY ( 'Table'[Date] ) = 21
            || DAY ( 'Table'[Date] ) = 31,
        CONCATENATE ( DAY ( 'Table'[Date] ), "st" ),
        IF (
            DAY ( 'Table'[Date] ) = 2
                || DAY ( 'Table'[Date] ) = 22,
            CONCATENATE ( DAY ( 'Table'[Date] ), "nd" ),
            IF (
                DAY ( 'Table'[Date] ) = 3
                    || DAY ( 'Table'[Date] ) = 23,
                CONCATENATE ( DAY ( 'Table'[Date] ), "rd" ),
                CONCATENATE ( DAY ( 'Table'[Date] ), "th" )
            )
        )
    )
VAR Month_Name =
    LEFT ( FORMAT ( 'Table'[Date], "mmmm" ), 4 )
VAR Date_Test_1 =
    CONCATENATE ( CONCATENATE ( Day, " " ), Month_Name )
VAR Date_Test_2 =
    CONCATENATE (
        CONCATENATE ( CONCATENATE ( CONCATENATE ( Day, " " ), Month_Name ), "_" ),
        Test
    )
VAR Date_Test =
    IF ( 'Table'[IsDistinct] = 1, Date_Test_1, Date_Test_2 )
RETURN
    Date_Test

 distinct.PNG

PBIX file attached.

 

Best Regards,
Icey

 

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

kentyler
Solution Sage
Solution Sage

If you have a column with the dates, and a column with the values "test 1", "Test 2" etc, then you could create a calculated column that combined the date and the label and gave you what you want to display on the bars.





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


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.