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.
I'm trying to create a table in Power BI that, at its core, displayed the frequency with which certain items are purchased. This data is being pulled from MS SQL and looks something like this:
From there, various calculations will be applied to each row. My trouble is that those calculations (measures) still need to run on the rows where the frequency of a given quantity was 0. Thus, what I figure I'm needing to do is add rows with a frequency of 0 for all quantities from 1 to the max value for each item.
My immediate thought is that this is much like completing a table with dates by joining to a date table. While I suspect this is the right approach, I'm running into 2 issues:
So is there any way I can get the filtered table to include the omitted rows up to the max and populate it with 0's so the calculations will run?
Solved! Go to Solution.
Hi @JonV
You may try below measure:
Measure 2 = VAR a = MAXX ( ALLSELECTED ( Table1 ), Table1[Quantity] ) RETURN IF ( MAX ( 'Table'[Quantity] ) <= a, CALCULATE ( SUM ( Table1[Frequency] ) ) + 0 )
Regards,
Cherie
Hi @JonV
It seems you may create a measure like below. Attached the sample file. If it is not your case,please share the sample data and expected output.
How to Get Your Question Answered Quickly
Measure = CALCULATE(SUM(Table1[Frequency]))+0
Regards,
Cherie
Hi @JonV
I cannot fully understand it. Could you provide the simplified data and expected output for us?
How to Get Your Question Answered Quickly
Regards,
Cherie
Hi @JonV
You may try below measure:
Measure 2 = VAR a = MAXX ( ALLSELECTED ( Table1 ), Table1[Quantity] ) RETURN IF ( MAX ( 'Table'[Quantity] ) <= a, CALCULATE ( SUM ( Table1[Frequency] ) ) + 0 )
Regards,
Cherie
Hi @JonV
Could you tell me if your problem has been solved? If it is,kindly mark the helpful answer as a solution and welcome to share your own solution. More people will benefit from here.
Regards,
Cherie
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |