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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

I want to replace the line chart to variance chart by month

my data is graphed in line chart but i want to replace it with varience chart to show to number change between month. But i could not find a proper formular or fuction to handle this. So the i could see the acutal month - previous month changed.

Thanks in advance.

 

Screenshot (44).pngVarience chart 2.jpg

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please try below :

My table:

 

Calender:

vbinbinyumsft_0-1659518467113.png

EWS_Result:

vbinbinyumsft_1-1659518516533.png

Model:

vbinbinyumsft_2-1659518539409.png

Try below DAX:

Hit Number Variance =
VAR cur_month =
    SELECTEDVALUE ( Calender[Month] )
VAR cur_count =
    COUNT ( EWS_Result[Trigger_Type] )
VAR pre_count =
    CALCULATE (
        COUNT ( EWS_Result[Trigger_Type] ),
        Calender[Month] = cur_month - 1
    )
RETURN
    SWITCH ( TRUE (), cur_month - 1 = 0, cur_count, cur_count - pre_count )

vbinbinyumsft_3-1659518629165.png

Please refer below attached .pbix file

 

Best regards,
Community Support Team_ Binbin Yu
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

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

Please try below :

My table:

 

Calender:

vbinbinyumsft_0-1659518467113.png

EWS_Result:

vbinbinyumsft_1-1659518516533.png

Model:

vbinbinyumsft_2-1659518539409.png

Try below DAX:

Hit Number Variance =
VAR cur_month =
    SELECTEDVALUE ( Calender[Month] )
VAR cur_count =
    COUNT ( EWS_Result[Trigger_Type] )
VAR pre_count =
    CALCULATE (
        COUNT ( EWS_Result[Trigger_Type] ),
        Calender[Month] = cur_month - 1
    )
RETURN
    SWITCH ( TRUE (), cur_month - 1 = 0, cur_count, cur_count - pre_count )

vbinbinyumsft_3-1659518629165.png

Please refer below attached .pbix file

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

Hi @Anonymous 
Please try

Hit Number Variance =
VAR CurrentDate =
    MAX ( TableName[Date] )
VAR CurrentMonth =
    MONTH ( CurrentDate )
VAR CurrentValue =
    SUM ( TableName[Hit Number] )
VAR PreviousValue =
    CALCULATE (
        SUM ( TableName[Hit Number] ),
        TableName[Date].[MONTH] = CurrentMonth - 1
    )
RETURN
    CurrentValue - PreviousValue
Anonymous
Not applicable

@tamerj1  

I try it but it trough an error on month. i think i send you more detail about my table.

My goal = i count the triggers (because it a string) and plot it by month. i think my problem would be related my Calender.

Thanks in advance and for your time.Screenshot (43).pngScreenshot (45).pngScreenshot (46).png

Hi @Anonymous 
1. Use COUNTA instead of COUNT
2. Use [Month_Number] column instead of [Date].[Month]

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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