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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply

matrix viual showing more data than expected

Hello,

 

i have an alert table linked to an association table that contains a status for each alert and finally an status table containing the status name.

 

the dataset can be found here 

and the data model here 

 

what i want is a matrix showing the number of alerts and the increase/decrease poucentage per status and per month 

 

for that i created two measures. The first is a simple count : 

nbr-alertes = COUNT(ALERTS[Alert_ID])
the second calculates the increase/decrease pourcentage :
evolution = DIVIDE([nbr-alertes],
CALCULATE([nbr-alertes],DATEADD(dates[Date],-1,MONTH)),0) -1
 
this one needed a dates table for dateadd function so i created it : 
dates = CALENDARAUTO()
and lined it to the alert table as you can see in the relational model
 
but my problem is that the matrix shows empty status row and that doesn't exist in my dataset and it also shows dates until December 2021, i don't understand why as i linked it to the alerts and the dates stop at march 2021 and i want the visual to do so too.
 
the pbix file is here 
 
any explanation on how all that works and a solution fo fix that please?
 
thank you.
1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @wahib_mouhoubi ,

 

This issue is caused by the time intelligence function.The date of the actual data cannot match the date in the time intelligence function.

Try to add a filter condition in measure:

evolution = IF(MAX(dates[Date]) in VALUES(ALERTS[CREATION_DATE]),
DIVIDE([nbr-alertes],
                    CALCULATE([nbr-alertes],DATEADD(dates[Date],-1,MONTH)),0) -1)

V-lianl-msft_0-1620025402729.png

 

 

Best Regards,
Liang
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
V-lianl-msft
Community Support
Community Support

Hi @wahib_mouhoubi ,

 

This issue is caused by the time intelligence function.The date of the actual data cannot match the date in the time intelligence function.

Try to add a filter condition in measure:

evolution = IF(MAX(dates[Date]) in VALUES(ALERTS[CREATION_DATE]),
DIVIDE([nbr-alertes],
                    CALCULATE([nbr-alertes],DATEADD(dates[Date],-1,MONTH)),0) -1)

V-lianl-msft_0-1620025402729.png

 

 

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

 

Hi again @V-lianl-msft ,

 

I reversed the condition 

evolution = IF(MAX(ALERTS[CREATION_DATE]) in VALUES(dates[Date]),
DIVIDE([nbr-alertes],
                    CALCULATE([nbr-alertes],DATEADD(dates[Date],-1,MONTH)),0) -1)

 

and it works perfectly ! 

 

thank you !

Hi @V-lianl-msft ,

 

First, thank you for your reply, it seem to work but, if i understood well, it calculates the pourcentage only if the the last date of each month is present in the alerts table, which is not necessarely the case in my real dataset, producing gaps in the pourcentage report (i've tried 

evolution = IF(MAX(dates[Date]) in VALUES(ALERTS[CREATION_DATE]) ||
               MIN(dates[Date]) in VALUES(ALERTS[CREATION_DATE]), 
               ....

but i still have gaps.

 

Any idea please? 

 

Thank you.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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