Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi all,
I am trying to write simple DAX calculation. But the visual filter does not work as expected for DAX calculations.
Simple DIVIDE calculation works fine, as below.
But with the conditional DIVIDE calculation the filter added to visual does NOT work.
Thanks in advance for any help.
Best,
-Shirish
Solved! Go to Solution.
Hi @Anonymous
I have test on your sample. I think your problem should be caused by ComplianceMonth column in your visual. ComplianceMonth column in your visual should be from Compliance table. However your filter Flag comes from related table Calendar.
So if you use ComplianceMonth column from Compliance table, the measure will show an incorrect result.
Try to use the column in Calendar table instead of the column in Compliance .
My test:
You see above table visual in red box will show incorrect results like yours.
Visuals as below which use MonthDate in Calendar table will show correct result.
You can download the pbix file from this link: File
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
What exactly is the problem? What result are you expecting? Explain the business context.
Thanks Ashish.
Here is the scenario,
I have 2 tables (Calendar Table and Compliance Table) as below and join using MonthDate,
Calendar Table as,
MonthDate Flag
1/1/2021 Y
12/1/2020 Y
11/1/2020 Y
10/1/2020 N
Compliance Table as,
MonthDate InComplianceCount TotalCount
1/1/2021 0 0
12/1/2020 4 4
11/1/2020 2 2
10/1/2020 4 4
And compliance percentage as,
% Compliance = DIVIDE(SUM(Compliance[InCompliance]),SUM(Compliance[TotalCases]))
When I create visualization (chart or table) with Flag = "Y" and Values as MonthDate, InComplianceCount, TotalCount then vislization has 3 rows of 1/1/2021, 12/1/2020, 11/1/2020.
But, with values as MonthDate, % Compliance then I see ONLY 2 rows 12/1/2020 and 11/1/2020.
Figured out missing 3rd rows as for 1/1/2021 the totalcount is "0". Tried various options with no luck.
Any help is greatly appriciated.
Thanks,
-Shirish
Hi,
You may download my PBI file from here.
Hope this helps.
Thanks Ashish for all your help and time.
I am trying to see if we can avoid using the slicer objects.
I created 2 variable as,
Hi @Anonymous
I have test on your sample. I think your problem should be caused by ComplianceMonth column in your visual. ComplianceMonth column in your visual should be from Compliance table. However your filter Flag comes from related table Calendar.
So if you use ComplianceMonth column from Compliance table, the measure will show an incorrect result.
Try to use the column in Calendar table instead of the column in Compliance .
My test:
You see above table visual in red box will show incorrect results like yours.
Visuals as below which use MonthDate in Calendar table will show correct result.
You can download the pbix file from this link: File
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |